Calculator - Pass Decimal Values To Radio Buttons So Can Calculate An Output Answer

Sep 2, 2011

To pass decimal values to radio buttons so I can calculate an output answer. it is a tip calculator. I am using radio buttons as options to choose what amount to tip, ie. 10, 15, and 20%. I need to figure out how to pass the value to the buttons in code so I can calculate the tip amount.

View 1 Replies


ADVERTISEMENT

Get Values From HTML Radio Buttons Inside A Repeater?

Dec 2, 2011

I have a simple questionnaire system which shows a random number of questions to the user out of a certain total in my database.I have 2 separate tables: Questions and Alternatives (which are the options to answer) related by QuestionID field in both tables. I rendered such questionnaire using Nested Repeaters (parentRepeater for questions and childRepeater for the options) and it shows correctly on the page.Each option is a radio button which I had to use it as a HTML instead of the Standard Server Control <asp:RadioButton> because of the Dynamic ID problem inside a repeater.[code]What I don't know is how do I get all the questions answered by the user given that I don't know the QuestionIDs and the Alternative IDs since it's randomly generated and using a HTML input tags?

View 1 Replies

Presision Calculations - Using Double Could Only Calculate Values Up To 18 Digits After Decimal

Jul 2, 2009

In the discussion in this thread: [URL] it was reveiled to me that vb.net, using double, could only calculate values up to 18 digits after decimal.... so I started thinking and came up with this class

Public Class LargeNumber
Private pNumber As String

Public Sub New()

[CODE].............

I want to split the string into a series of doubles.... and than combine them into a large number.... The size of each double component should be 18 digits on a 32 bit computer... so that I will have room to add the last carrier...

View 3 Replies

Quadratic Calculator - Answer Comes Up As NaN

May 29, 2010

I'm new to the server and I'm making a quadratic calculator with my friend. I have my calculator coded, but whenever i click the calculate button the answer comes up as "NaN". Here is the code.
TextBox4.Text = (intVarB * (-1)) + (((intVarB ^ 2 - (4 * (intVarA * intVarC))) ^ 0.5) / (2 * intVarA))
The Variables "IntVarA", IntVarB, and IntVarC are defined as public variables in a code module.

View 4 Replies

How To Squeeze Answer In Radio Button

Mar 17, 2009

I have a radio button. Four in fact. All connected to a database. The Radio buttons are the answers to the questions. Button A, B,C, and D. Now in the database some of the answers are very short, one or two words, but some can very lengthy. So, my answers seem to disappear if lengthy (argh), I cannot make them shorter. How do I squeeze the answer in the Radio button? Can I add what.I do not want to change from radio button to something due to the extreme low knowledge of VB08.

View 9 Replies

Check Boxes And Radio Buttons - Value Is Not Being Updated Until I Select A Different Radio Button?

Oct 10, 2011

trying to write a simple form for calculating professor's salaries depending on their degree and position.my problem is that the when i select a check box, the value is not being updated until i select a different radio button. it probably doesn't make much sense here,

Public Class frmMain
Private Sub optLecturer_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles optLecturer.CheckedChanged[code]....

the values being assigned to my salary label are correct, but are not being updated until i select a new radio button. im not entirely sure how to get around this so that the value is updated as soon as i select the check box.here's when the program looks like:

View 1 Replies

Make A Calculator That Adds From Two Text Boxes And Displays The Answer In Another Box?

Apr 23, 2010

I'm trying to make a calculator that adds from two text boxes and displays the answer in another box, but It gives an error when someone enters a character. What can I do to display a string error message in the third box if a letter is entered in one of the first two boxes instead of a number?

View 1 Replies

Basic Addition Calculator - Display Entire Arithmetic Solution Including Answer

Dec 22, 2008

I am using Visual Studios 2008. I'm trying to make a basic addition calculator. It consists of 2 input text boxes, 1 output box and one button. Below is the code I have which works, however, instead of just displaying the answer, I want it to display the entire arithmetic problem including the answer. For example. Instead of just giving me the answer of "6" in the output text box, I want it to say "3 + 3 = 6".

Here is the code I have so far.
Public Class Form1
Private Sub btnAddition_Click_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddition.Click
Dim num1, num2, sum As Double
[Code] .....

View 4 Replies

Textbox And Calculate Button - Separate Label For Answer

Feb 26, 2012

I'm using Visual Basic Express 2010. I have the prompt, the textbox and the calculate button. For the answer do I have to make a separate label for the answer in seconds and the actual response "That will take (separate label for answer) seconds" I made a click event button and assigned the following as global variables at the start of the form:

Const intSpeed As Integer = 1207
Const intTime As Integer = 3600

Then I made a click event for the button. I don't know what the formula is. Basically the user inputs a distance in the box, the calculate button tells you how long it will take for the vehicle to travel that distance in seconds.

Here's the interface: [URL]

Criteria:
Are We There Yet?
The Thrust SSC, a super fast vehicle tracked at 1207 Km per hour (750 mph) was clocked on the Black Rock desert back in 1977. Build an application that will tell people how many seconds it would take to get to their destination if they were driving the vehicle. Of course this doesn't include having to stop for stop signs, travel through school zones, or slow down for corners.

You need to include the following:
1.) Design the application with a prompt label and textbox to collect the distance from the user.
2.) A calculate time button
3.) The form must have the text property changed to read "Are we there yet?"
4.) The objects must have both the Text property and Name property changed to an appropriate value.
5.) A constant global variable should be used to represent speed of the vehicle.
6.) A constant global variable should be used for seconds (there are 3600 seconds in an hour)
8.) A local Dim variable declaration can be used within the button click to hold the distance value.
7.) Variables should be declared with the most appropriate data types.
8.) Include a "Text Changed" event to reset the time in seconds to a blank value when the user starts entering in a new distance.
9.) Comment code should be included

View 4 Replies

Make Program To Calculate Textbox1.text And Show The Answer In Textbox2

Dec 22, 2011

I am working on bit more advanced calculator, but I cant figure out how I can make my program to calculate textbox1.text and show the answer in textbox2

For example: (textbox1) 5*62+4
(textbox2)314

I'm not sure this question belong in this topic, but I don't know where else it should be?

View 16 Replies

Using A Dialog Form With Two Buttons And Two Radio Buttons?

Jun 12, 2011

I'm using a dialog form with two buttons and two Radio buttons.I'm oppening this Dialog when a button is clicked on the parent form.My situattion is when the Dialog opens the code in the button event continues to execute, but I only want it to continue to execute only after a button from the dialog form have been clicked

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
If multipleEXT = 2 Then
Extension.Show()

[code]....

View 3 Replies

VB - Form With Fairly Large Number Of Controls - After Curtain Number Of Buttons - Stops Responding To More Radio Buttons

Jan 17, 2011

My VB application is behaving strangley. I have form with fairly large number of controls. I am using case against radio buttons. after curtain number of buttons, it stops responding to more radio buttons.

Then I tried to split controls in to 2 form but now my form.showdialog() too now working properly. It takes new from names but show the old form when running.

View 7 Replies

Decimal Point In Vb Calculator?

Dec 11, 2009

what is the code for decimal point in vb calculator?

View 2 Replies

Decimal To Binary Conversion In A Calculator

Jan 6, 2010

I have this code for a decimal to binary conversion in a calculator. It is working, but when I entered numbers with decimal, the conversion didn't work.[code...]

View 3 Replies

.Net Calculator - Allow The User To Select Which Way They Want To Calculate The Mortgage

Jan 1, 2009

Write the program in VB.Net (not Web based) with a graphical user interface. Allow the user to select which way they want to calculate the mortgage: By input of the amount of the mortgage, the term of the mortgage and the interest rate of the mortgage

[Code]...

View 2 Replies

Intercepting The 0 Key And Decimal Point Validation In A Calculator?

Feb 27, 2010

I create a calculator in visual basic and I put button from 0 to 9 ... and event click textbox1.text = textbox1 + "1" (to 9) ..it work good .. but if i press key 0 from keybord nothing is hapens ..

and the secoun problem .. if I put for example 3.25.89 not 3.2589 how can write in code a "if" for example if textbox1.text -alredy contain a point (.) 3.25 then I click again on button point .. it remain 3.25 but not 3.25.

View 3 Replies

Octal Binary Hexadecimal Decimal For Calculator

Jun 4, 2009

Im looking for the correct solution for the 4 radiobuttons for my scientifc calculator also to calculate within it.

i have something like this: but i dont think its good enough

Private Sub rbHex_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbHex.CheckedChanged

[Cdoe].....

View 13 Replies

Change Calculator And Is Supposed To Calculate The Number Of Dollars?

Sep 16, 2011

I am trying to learn how to use the modulus operator.this excersise is a change calculator and is supposed to calculate the number of dollars , qtrs, dimes, nickels and pennies from the change that is calculated.

in the form if i put a value in for owed = 30.00 and paid 34.25 my dollars returned = 4 and that is correct but the number of qtrs = 0 and should be 1. I am not sure how to correctly use this - any assistance you can provide is great - this is purely educational

Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
Dim owed As Decimal
Dim paid As Decimal
Dim change As Decimal

[Code]...

View 8 Replies

Calculator Application - Use Datatype - Variables Be Single Double Decimal ?

Mar 11, 2009

I am writing an calculator application and i dont know what datatype to use. i mean should the variables be single, double, decimal...?

View 1 Replies

Make A Calculator With One Textbox And 16 Buttons?

May 8, 2012

I am trying to make a calculator with one textbox and 16 buttons. Buttons are:(0,1,2,3,4,5,6,7,8,9,+,-,*,/,=,C). So here is code for now:

vb.net Private Sub nula_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nula.Click
TextBox1.Text = TextBox1.Text & 0
End Sub
Private Sub jedan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jedan.Click
TextBox1.Text = TextBox1.Text & 1

[Code]...

When I add those numbers and operators its easy, but how make operations really work now?

View 4 Replies

Create A Calculator That Can Calculate The Sum, Product, Difference, & Quotient Using An External Class?

Apr 26, 2011

So I was assigned to create a calculator that can calculate the sum, product, difference, & quotient using an external class. Unfortunately my teacher isn't exactly the best and I'm new to VB, I know how to create a calculator in VB .NET but when it comes to external classes,

View 3 Replies

How To Add Radio Buttons Together

Jun 8, 2011

im trying to add two radio buttons together to get a full price, they are split up by two group boxes. Meals and dormitories, I have the prices on how much they are, but I dont know how to put the right radio buttons in the right places and then add them up, here is the code I have so far

Public Class Form1
Const decRadioButtonmichigan As Decimal = 1500.0 ' this is suppose to go in the dormitories group box

[code]......

View 7 Replies

How To Use Radio Buttons

Mar 10, 2010

I am trying to figure out how to use radio buttons.when the radio button is selected it should display a integer number in the text box.

This is what i have so far[code..]

View 4 Replies

Radio Buttons And If ... Then ... If / Else

Mar 11, 2010

My homework is the following: public Class Form1

[Code]...

View 11 Replies

Calculate Total Of Decimal Textboxs

Jun 10, 2009

I have two textboxs are formated to decimal type. i want create thirth textbox and get total of above two textboxs. how can i do that.

[Code]...

View 13 Replies

Add 16 Radio Buttons To A Groupbox?

Oct 26, 2009

I have a need to add 16 radio buttons to a groupbox but I want to be able to select 2 radiobuttons per groupbox. (2 vertical columns of 8 radio buttons each) The radiobuttons are created dynamically and each set of eight have different names to distinguish them. Do I really have to create 2 groupboxes and put each set of 8 in each groupbox and put those groupboxes into my parent groupbox? Is that it with radio buttons...if they are all in 1 groupbox then there is no way to select more than one at once?

View 1 Replies

Coding Radio Buttons In VB?

Feb 25, 2009

I'm having issues with my current homework. I've got 6 different radio buttons and depending on which one is checked, the corresponding price shows up in the text box. I'm not sure if I need to create a sub-procedure or what. I can't seem to get anything to work.

[code]...

I've gotten this far with the code but not sure where to go next.

View 3 Replies

Get Status Of All Radio Buttons?

Aug 25, 2011

I've figured out how to run through the radio buttons and save their checked status to a text file. Now Im trying to recheck them according to the value. Here is what I have.[code]...

View 1 Replies

List Of Radio Buttons

Feb 27, 2009

Is it possible to create a list of radio buttons similar to that of a checked listbox?And the list of radio buttons should be able to be managed like that of a CheckedListBox?

View 2 Replies

Make Radio Buttons And SQL?

Feb 26, 2009

I have several textboxes in my form and a groubbox that have four radiobuttons. I want all the values of the textboxes (and the selection of the radiobuttons) to be stored in sql server. As far as the values of the textboxes in concerned, I managed to do it. But what about the selection of the radiobuttons??? This is the code I am using for the textboxes:

objConnection.Open()
objDataAdapter.InsertCommand = New SqlCommand()
objDataAdapter.InsertCommand.Connection = objConnection

[code].....

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved