W
weg22
Hi all,
I'm trying to iterate through several text boxes and perform
calculations with the data. I'm using the following code which
compiles and executes successfully...but only does half of what I need
it to:
For Each ctrl In Controls
If TypeOf (ctrl) Is System.Windows.Forms.TextBox Then
MSB = Val(ctrl.Text) >> 8
LSB = Val(ctrl.Text) - MSB * 256
End If
Next
If I print the MSB and LSB values, it appears that the above code is
looping through the Text Boxes in a different order than I need it
to. Instead of rearranging all of the Text Boxes in my application,
is there away to define the "ctrl" value for each text box (i.e. can I
specify the order of how to loop through eact Text Box)?
Also, if I move these Text Boxes onto a "TabControl", the above code
no longer works. Can someone please explain this as well?
Thanks in advance,
-weg22 ([email protected])
I'm trying to iterate through several text boxes and perform
calculations with the data. I'm using the following code which
compiles and executes successfully...but only does half of what I need
it to:
For Each ctrl In Controls
If TypeOf (ctrl) Is System.Windows.Forms.TextBox Then
MSB = Val(ctrl.Text) >> 8
LSB = Val(ctrl.Text) - MSB * 256
End If
Next
If I print the MSB and LSB values, it appears that the above code is
looping through the Text Boxes in a different order than I need it
to. Instead of rearranging all of the Text Boxes in my application,
is there away to define the "ctrl" value for each text box (i.e. can I
specify the order of how to loop through eact Text Box)?
Also, if I move these Text Boxes onto a "TabControl", the above code
no longer works. Can someone please explain this as well?
Thanks in advance,
-weg22 ([email protected])