|
-
Oct 1st, 2003, 08:04 PM
#1
Thread Starter
Registered User
control arrays
how do i refer to objects like text boxes as if they were in an array. basically i want to be able to say
(TextBox + i).Text = "..."
basically, how can i refer to a textbox where i have a variable of type string as the name of the textbox?
thanks
-
Oct 1st, 2003, 08:45 PM
#2
Sleep mode
If you mean like control arrays as in VB6 , then this's already died out .
-
Oct 1st, 2003, 08:46 PM
#3
here's one way ...
VB Code:
[color=blue]Dim[/color] tb [color=blue]As[/color] Control
[color=blue]For Each[/color] tb [color=blue]In MyBase[/color].Controls
[color=blue]If[/color] tb.Name = "TextBox1" [color=blue]Then[/color]
tb.Text = "some text"
[color=blue]End If[/color]
[color=blue]Next[/color]
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Oct 1st, 2003, 08:57 PM
#4
Sleep mode
Originally posted by dynamic_sysop
here's one way ...
VB Code:
[color=blue]Dim[/color] tb [color=blue]As[/color] Control
[color=blue]For Each[/color] tb [color=blue]In MyBase[/color].Controls
[color=blue]If[/color] tb.Name = "TextBox1" [color=blue]Then[/color]
tb.Text = "some text"
[color=blue]End If[/color]
[color=blue]Next[/color]
If he really means controls array , then it isn't this one
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
|