|
-
Jan 22nd, 2012, 08:29 AM
#1
Thread Starter
New Member
Strings to integers in a list box
Hi all,
List boxes in VB 6 can be filled with strings,bit how can I fill them with integers?.
For example if I wanted to take a number from list box 1 and add it to list box 2 and place the result in a textbox.
One way round it is by initiating a load of Int variables then adding an If statement like this
Dim a As Int
Dim b As int
If List1.Text = 1 then
a= 20(or any integer)
end if
If List1.Text = 2 then
a= 20(or any integer)
Text1.Text = a
..and so on.But this could take all day especially if I have hundreds of numbers in my list box.
So is there any way I can just convert the strings to integers...or even just enter the list box items as ints(or floats or any numeric)
Kind Regards
Tommy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|