|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
TRYING to INDEX a FORMWHY can't I do this?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim i As Byte For i = 1 To 10 Me("textbox" & i) = i Next End Sub "Daniel Kaseman" <d**@cfaith.com> schrieb: First: Using 'Byte' as type of index variables is not a good idea, it's > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles Button1.Click > Dim i As Byte > For i = 1 To 10 > Me("textbox" & i) = i > Next > End Sub better to use 'Integer' instead. Accessing controls by their names or indices <URL:http://dotnet.mvps.org/dotnet/faqs/?id=controlbynameindex&lang=en> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Thank you, that worked.
Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:%23QELV1tQFHA.576@TK2MSFTNGP15.phx.gbl... > "Daniel Kaseman" <d**@cfaith.com> schrieb: >> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As >> System.EventArgs) Handles Button1.Click >> Dim i As Byte >> For i = 1 To 10 >> Me("textbox" & i) = i >> Next >> End Sub > > First: Using 'Byte' as type of index variables is not a good idea, it's > better to use 'Integer' instead. > > Accessing controls by their names or indices > <URL:http://dotnet.mvps.org/dotnet/faqs/?id=controlbynameindex&lang=en> > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/>
Table doesn't update - What am I doing wrong?
Stuck with calss in listbox retrive record ID on insert Go to URL on Button_Click Question about Destructors Errors when translating CultureInfo from C# to VB Seeting File Attrubites mysql date format access all items in a datagrid Cloning a derived control |
|||||||||||||||||||||||