VB2005 How to write this (Textboxes)

Rexyss

Member
Joined
Jan 3, 2008
Messages
12
Programming Experience
Beginner
Hi, how can i write this code..
Trying to find an easy way to collect text from a lot of textboxes to one String Variabel

VB.NET:
Dim Index as Integer = 1
Dim Clipboard as String = ""

Do Until Index = 39
Clipboard = Clipboard + Textbox(Index).text
Index = Index + 1
Loop

Msgbox (Clipborad)

Best Regreds
 
Me.controls(controlname or index)
Also use a StringBuilder to build strings.
And never use the + operator to concenate strings, only & operator.
 
Me.Controls(controlname or index)

Im not sure how to use that. (Tryed MSDN)

Is it possible to give a simple example??
Maybe just something like this:

(For textbox 1 to 20)
Textbox().Enable = True
 
"controlname" means the name of the control, "index" means the index of the control in the controls collection.
VB.NET:
dim tb as textbox = me.controls("texbox1")
 
Back
Top