Click to See Complete Forum and Search --> : Problems with vb.net program


walkm0
May 1st, 2002, 02:44 AM
I am testing out the new changes in vb.net. I'm having problems with the listbox control. I have a form with 4 textboxes, listbox, command button. I enter integers into the 4 testboxes. I then click the command button and want the values of the four textboxes, divided by themselves, to display in the listbox...Example
output
1
1
1
1
I click the command button and there is no output. I know how to use listbox1.items.add(textbox1.text) to put the original value of the textbox1 into the listbox...but i can't do anything with a variable...example

dim x as integer
x=textbox1.text /textbox1.text
listbox1.items.add(x)

you could in vb6??? could someone point me in the right direction..thanks

Thanks in Advance

Vafis
May 1st, 2002, 03:06 AM
maybe you should convert the textboxs' values in integer

John G Duffy
May 1st, 2002, 10:00 AM
Your example worked just fine for me, Identical code, no changes whatsoever. I pasted it into a Command Button Click event and ran it.

'
'
Please rate it if it answers the question
or is useful.
'
John G

John G Duffy
May 1st, 2002, 10:24 AM
But you might try this

listbox1.items.add(x.ToString)





'
'
Please rate it if it answers the question
or is useful.
'
John G

walkm0
May 1st, 2002, 01:24 PM
I am getting the "too many arguments to Public overloads function add(item as object) as integer"

I just figured you could still use strings and integers like the VB6 listbox.

VB6 & vb.net are like apples and oranges.

Thanks in Advance