Multiplying Two Variables?

Dec 2, 2009

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]

View 3 Replies


ADVERTISEMENT

Multiplying Two Textboxs?

Dec 18, 2010

in my project i am using this code to multiply to textboxes value

(
Dim tot As Integer

[code].....

View 1 Replies

Multiplying Without Using A Button?

Apr 9, 2011

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.

View 4 Replies

Multiplying Datagridview Columns?

Jul 15, 2009

(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 Replies

Multiplying The Contents Of An Array?

Sep 6, 2011

I'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 Replies

Multiplying Two List Boxes

Jan 7, 2011

I 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 Replies

Multiplying Odd Numbers In Sequence Using MOD Function?

Jul 2, 2010

Then 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].....

View 6 Replies

Multiplying Two Or More Lines In Two List Boxes?

Oct 7, 2009

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 Replies

VS 2010 : Multiplying Two Values When TextChanged?

Sep 18, 2010

How 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.

View 4 Replies

Multiplying The String Representation Of REAL Numbers?

Jan 12, 2012

<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]...

View 5 Replies

VS 2005 - Multiplying Integer With Content Of Textbox

Aug 22, 2009

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

View 17 Replies

Multiplying Minutes With Price Data Type Is Money?

Apr 4, 2009

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]...

View 2 Replies

Manipulating Items In A Listviwew (summing Columns And Multiplying Cell)

Dec 22, 2011

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

View 4 Replies

Forms :: Multiplying By Two - Code - Radio Buttons That If Selected Will Display The Price Of A Ticket

Mar 22, 2010

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.

View 8 Replies

Setup A Function Involving Multiplying A Cell By A Set Number And Then Having The Result Round To The Nearest 10?

Apr 22, 2009

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 Replies

VS 2008 - Take A String Of Variables With A Common Delimiter And Break It All Back Out Into Separate Variables

Dec 11, 2011

Last year (2010) I came across a FANTASTIC command that allowed me to take a string of variables with a common delimiter and break it all back out into separate variables (possibly an array) with one statement.

[Code]...

As long as the delimiter was a unique specifiable character, this one-statement command could break it out into elements. my memory and point me in the right direction.

View 2 Replies

Passing Multiple Byref Variables / Variables Fail To Change Calling Funct W/ Invoke

Sep 27, 2010

I have code, shown below, that works all except for 1 thing: The variables being passed byRef get passed, but once modified in the else section of the "if me.invokerequired" code of RecordData, the variables are never updated in the calling function. To reiterate, the calling function does not receive the updated data that is in the variables custid and amt.When debugging, I see the data change in the else section of "if me.invokerequired", but once it returns from the callback the data is missing.[code]

View 15 Replies

Define Some Global Variables Of A Class - Variables Occupy Memory?

Mar 23, 2012

I define some global variables of a class as follows:

Private Class MyClass
Private var1 as Decimal
Private list1 as List(Of string)[code].....

But I found that after this form is closed, all above variables, var1, list1, list2 still exist in memory. I thought they should be collected by gc since the form is already disposed as I confirmed.

Add: I have monitored half an hour after the form is closed. But these variables are not collected by gc. I have an automatic update procedure on the form which uses above variables.Since the above variables still hold values, the automatic update procedure is always called which causes exception. (One quick fix is to check if form.isDisposed in update procedure. But I do not think this is elegeant. Besides, these variables occupy memory.)

View 2 Replies

Memory Used In Declaring Variables Are Reclaimed By The OS When These Variables Go Out Of Scope?

Jan 7, 2010

Does the memory used in declaring variables are reclaimed by the OS when these variables go out of scope?Does the memory used be released by setting thier value to nothing? if not, then how can I force the garbage collector to run or excecute at a certain/desired time..How about in Windows Forms..How can we make sure that the memory used in initializing and showing forms be released if those forms were closed?

View 13 Replies

Multithreading: Reading/setting Variables, And Passing Variables?

Mar 8, 2011

Question 1: What is the difference between "Background Worker" and "Worker Pool" as indicated within the MSDN samples provided.

Question 2: I noticed while using, AddressOf _Function_, variables cannot be passed; what would be an efficient solution to this?

Question 3: While using multithreading is it required to invoke before setting variables, or only form properties?

Question 4: While using System.Net.Sockets is it safe/efficient to use Application.DoEvents while waiting for new data; or would be using a Do While loop be fine without DoEvents since the action would be multithreaded? Note: there can be up to 2000-3000 sockets in use at a time.

View 10 Replies

Use Variables Or Properties, And Global Or Static Variables In A Class?

Jun 9, 2012

I'm new in .NET programming.I have a class Form1 that includes Button1_Click event.Button1_Click creates a multiple Text Boxies at run time)Here is the class:

Public Class Form1
Dim shiftDown As Integer
Dim counter As Integer

[code].....

View 3 Replies

Adding Number In A Listbox Then Multiplying By A Number Using One Button?

Oct 14, 2011

adding all the numbers in a list box then multiplying it by a %.theres one listbox and two buttons, and two textboxes.i've completed everything but this and can't fibd it in my book. I just looking for pointers. this is what i have which i know isn't right

Dim sum, cost As Double
sum =
cost = sum * 0.06
lstbox.Items.Clear()
lstbox.Items.Add("Total Commission =" & cost & ".")

View 4 Replies

How To Get Three Variables

Dec 14, 2009

I have text for example:11.12.2009 or 7.8.2004 and how to get three variables, a, b, c

a = 7
b = 8
c = 2004

View 8 Replies

Possible To Use Variables Without DIM?

Jul 10, 2011

Is it in VB.NET possible to use variables without the need of use DIM? Now I have to use the variables like this:
dim a = 100
dim b = 50
dim c = a + b

I want to be able to use vars in this way:
a=100
b=50
c=a+b 'c contains 150

I think in VB6 and older VB this was possible, but I am not sure.

View 2 Replies

.net - Get The First Two Variables Parametrized

Feb 6, 2012

This is the updated code:

sql = "INSERT INTO Strings (String_Name, Long_Text, Short_Text, Alternate_Text, Multi_String_ID, Lang_ID) VALUES (?,?, ?,?,?,?)"
Dim command = New OleDbCommand(sql, pConn)
command.Parameters.AddWithValue("@webStringName", "String_Name")

[code]....

I am trying to create and INSERT statement with and OLE adapter. I had it working without paramtersm but now I am trying to add parms and am having issues with the syntax.Here is the code so far...

command = New OleDbCommand(sql, pConn)
sql = "INSERT INTO Strings (String_Name, Long_Text, Short_Text) VALUES (?,?, """ & ptsShortText & """)"
command.Parameters.Add("@webStringName", OleDbType.VarChar, 250, "String_Name")
command.Parameters.Add("@webLang_String", OleDbType.VarChar, 250, "Long_Text")

[code]....

Was just trying to get the first two variables parametrized.

View 1 Replies

Add 2 Strings Variables

Jul 14, 2011

I used to add 2 strings variables and it works but when I tried using VB2008 it didn't work. [code]

View 9 Replies

Any Way To Fill Two Variables Within One?

Sep 30, 2009

I got a problem dealing with variables: I would like in an if-then-else following
If FZ1_KaskoTextBox.Text = 1 And Grundwert_Kasko <= 10000 And FZ1_BMComboBox.Text = 9 Then PraemieKasko_KFZ1_Var1 = 169.33 And PraemieKasko_KFZ1_Var2 = 169.33 Else
But the variables don't get filled?! is there any possibility to fill two variables within one "then" ...

View 5 Replies

Appending To A Variables Name?

Sep 22, 2011

s1nickelFrontImage is a declared variable, and I have others similar to it, they run up to 10.

how can I append/change the variable 's1nickelFrontImage1' to 's1nickelFrontImage2', and so forth, until LOOP is complete.(always increases by 1)

Do While ac1IMGPtoCCount > 0
ac1ImgPtoCString = ac1ImgPtoCString & s1nickelFrontImage1
ac1IMGPtoCCount = ac1IMGPtoCCount - 1
Loop

View 1 Replies

Asp.net - Using Session Variables In IE?

May 14, 2012

I have an ASP.NET application that I am developing. I'm using session variables within the app.In Firefox & Chrome, they all work.But in IE (ver 9), there's one variable that's not working. I'm not sure if it's a storage or a retrieval (or both) at this point. The variable in question that I'm storing is a List(T) type. It's the only one of it's kind that I'm using. Can't help but think there's a correlation there.One other old post mentioned the possibility that cache is causing the problem, but I didn't understand the answer very well.

Dim Rec_IDs As New List(Of String)
Rec_IDs = Session("Rec_IDs")
and
Dim Rec_IDs As New List(Of String)

[code].....

View 1 Replies

CSV File Into Many Variables?

Mar 19, 2010

I have a CSV file with 35 fields. I have to read it into 35 variables. i know I can read the line, split it, write 35 assignment statemens. I am looking for an easier way (because I am lazy).

I'm looking for something like ReadCsvFile (A1, A2, A3, A4...A35) that will read a line, split it, and make all the assignments.

View 1 Replies







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