Multiplying Two Textboxs?
Dec 18, 2010in my project i am using this code to multiply to textboxes value
(
Dim tot As Integer
[code].....
in my project i am using this code to multiply to textboxes value
(
Dim tot As Integer
[code].....
how would i go by multiplying two variables..
ListBox1.SelectedItem.ToString() * Label1.Text.ToString() = Label2.Text
is what i have but it seems to not want to do it... [URL]
I'm new to vb and I am currently trying to code a Program for counting cash from a till. I know how to multiply and add if I were to use a button to execute it but what I want is for the totals to be automatically populated as soon as the user inputs the data.
Example:User inputs 23 into the txt1cent textbox
So the program should multiply 23 by 0.01 and output the answer (0.23) into txtsum1cent textbox.
(All of this is in a datagridview) i would like to know if it would be possible to say, take Columns 1 and Column 2 and multiply the value of each row and post it to a Column 3 with each row in Column 3 reflecting the multiplied values of the previous 2 columns..
View 6 RepliesI've got an array of type double with about 30 entries(numbers) in it.I need to multiply them all together. Sort of like "=product(A1:A30)" in Excel (formula).
View 1 RepliesI have two list boxes created. One is Quantity and other is Price. When i enter price and quantity i want it to multiply and add one by one and give me the total in a label below...The problem is when I have two or more items in each list box I'm unable to come up with the total. I figured out that it will need a loop. So my question is that how should i use the loop. I haven't learn't how to make loops..
View 6 RepliesThen you have to take that same range and find the product of all odd numbers between said sequence. I figured out how to find the product but only if the lowest number is also an odd number. For example, if I put in the values 1 and 7 the product is 105 which is correct. But if I put in 2 and 5 the product somehow becomes 10, when it should be 15.I have to use the MOD function to distinguish between even and odd numbers, which I know how to do however it's still not working out correctly for some reason and I'm completely stuck. This is the part I'm having trouble with. Go down for full source)
For counter = intX To intB
intX = intProduct
If intY Mod 2 = 0 Then
[code].....
I have two list boxes created. They are populated when I enter the quantity and the price (one list box for each). This data actually comes from another set of text boxes. The problem is when I have two or more items in each list box I'm unable to come up with the total. I need to take the quantity * price for each entry and then add that to the quantity * price for the other entries. When I press my "total" button it's only doing the calculation for the first line.
View 2 RepliesHow can i possibly multiply two values in datagrid when a text change happens. Here is my layout:
Here is the code I used but its giving me an error:
Private Sub dgvSalesEntry_CellValueChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvSalesEntry.CellValueChanged
Dim ind = dgvSalesEntry.CurrentRow.Index
[code]....
Error Message: An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object.But when I deleted the codes above I can run my system.
<edit> Now showing the difference as a DECIMAL. Result looks like zero every time. </edit>Disclaimer: This code is provided "as-is" and should be treated as Freeware.( However any donations would be welcome as I have a "so-so" part-time job ).Please note all real numbers to be used should be in this format
"0.000000000000"Do not use numbers in string format in scientific notation like "1.2345E -06"I was feeling bored and decided to add to the code from JohnWein in this thread where I have used a routine that will multiply the contents of two long strings together.>>[url]I have now added a bit of code so you can multiply two really long numbers with or without a decimal point as a full-stop ( period or dot, call it what you like ).
[code]...
I am getting error on the following code
Private Sub tot()
Dim temp As TimeSpan = TimeSpan.Parse(wetothrs0.Text)
wtothrs0.Text = temp.ToString
Dim employeeCost As Integer = CInt(temp.TotalHours)
wtotcost0.Text = employeeCost * hrate0.Text
End Sub
wtotcost0.text is a textbox
employeecost is integer
hrate0.text is integer that is coming from database
i have problem multiplying total minutes of user login with price. for example, my price for 10 minutes is 100. if user A start login at 9.00 am and logout at 10.00 am, that means he spends 60 minutes using the computer. how to multiply 60 minutes with 100 (my price) so that i could get the correct price and update the data to my database?
[Code]...
I have tried several means all to no avail. how sum items in the column of a listview
dim lv as listviewitem
lv=listview1.items.add(txtscore)
lv.subitems.add(txtunit)
lv.subitem.add(grade)
I have suceeded in adding scores, unit and grade to the listview and i dont know how to sum the total unit in column 2 and how to get point to calculate the gpa
i am trying to do is i have two textboxs which have figues in them and need the 3rd textbox to display the figure the code.[code]I want the answer doesnt display in the textbox as i want it but when i click on the text box nd type anything the answer shows but in the error
View 6 RepliesHow to create the TextBoxs?
[Code]...
This code when Run can create 100 textboxs but we can't see all that textboxs because outside the bottom Form.How to arrange on Form 10 row textboxs until enough 100. [code]....
View 8 RepliesI have 3 textbox and all three have a maximum limit of 4, 3 and 3 is there a way of highlighting a telephone number and pasting it into the first box, and the other 2 boxs are automatically filled.
View 2 RepliesI have set-up a tab control and have buttons set up to add and remove the tabs.I want to place a text box into all the tabs, so when a new tab is added a text box is already placed inside the tab. I am not sure on how I would do this.
Dim myTabPage0 As New TabPage()
myTabPage0.Text = "Event " & (TabControl1.TabPages.Count + 1)
TabControl1.TabPages.Add(myTabPage0)
[code].....
I have 4 TextBoxs on Form1 to pass value to 4 Labels on Form2.
[Code]....
I know the title spounds stupid. I will try to explain what I meen. I am trying to make a product key mask. for example: I was able to do this with the MaskTextBox but I want to seperate each line to there own text box For example: [Textbox1] - [Textbox2] - [Textbox3] - [Textbox4] - [Textbox5] I already limited the Textboxs to 5 characters. The problem I am having is, after I enter 5 characters in the first textbox, I cant get the cursor to auto tab to the next textbox. I have already tried fixing it with this code
[Code]...
I am working on an internet cafe program for the desktops. This is how it works, the login files are stored on a ftp server in the form of txt files (E.G. USERNAMEpassword). The files are opened in the background of the program. Then once the login button is clicked, the two text boxes (passwords and username) will combine together and then in the background will look for the username and password as a single line of code.
login.txt:
johndoe12345678
jasmine373249273
jg236219
open a txt file without the open file dialog and to save without the save file dialog.
P.S. I'm using a textbox.
I would like to know how to loop with textboxs. For example. I would set the text to "Hello" And the loop will send this...
-"Hello1"
-"Hello2"
-"Hello3"
I have tried many looping techniques but they all used listboxs and even modifying them I could not get it to work correctly.
CODE:
Right now i have the following code. it is 4 radio buttons that if selected will display the price of a ticket.
There is a button called "repeat offender" that should take the price and double it. so me, being new to visual basic, were thinking of trying an if statement such as If it is selected decTicketTotal * 2
But this did not work. any help would be appreciated.. just trying to get the repeat offender selection working so when it calculates the price will double.
I am working in excel trying to setup a function involving multiplying a cell by a set number and then having the result round to the nearest 10. Here's the beginning of my function statement fx=e3*1.026. say the result is 8654, I need it to round to 8650. Also if it comes back 8655, I need it to round to 8660. I have about 2,000 records I need to do this to so I was hoping that one formula or statement could be used for all my data.
View 2 RepliesI coded my textbox to be only type in numeric numbers. But the backspace doesn't work when I run the program anymore, Can't delete what has typed in the textbox.
Here is my code
Private Sub AmountTextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles AmoutTextBox.KeyPress
Dim allowedChars As String = "0123456789"
[code]....
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]...
Basically I want to to be able to insert things into my textboxes on vb.net and for them to go into my microsoft access file and into the customers table when I click the save button. I tried doing it myself I didn't succeed my work kept on erroring with this:
[code]....
Now my database is called: Kit-tactic.accdb The fields I hold are: forename, surname, dob, housenumber, address 1, address 2, postcode, contact
I desided to follow the basic instructions cearfully. I have managed to find my way through the database programming using the odbc class.And I was successfully able to populate records from the database to listviews, treeviews, comboboxs and all sort of controls.Now I am working on phase 2 of my project whitch is writing back to database.... but unfortanilty I did not find a good illustration of how to do that using odbc data adapters.I am trying to send data from textboxs an listviews..
View 2 Repliesim creating a stopwatch with 3 textboxs and one button which is restart button the watch automatic start by itself how would i create.
View 1 RepliesStop Watch With Three Textboxs And Button
View 2 Replies