|
-
Jul 31st, 2000, 02:56 PM
#1
Thread Starter
Addicted Member
Hi,
How can I initialize a lot of TextBox like below:
TextBox1.Text = "0"
TextBox2.Text = "0"
TextBox3.Text = "0"
TextBox4.Text = "0"
TextBox5.Text = "0"
TextBox6.Text = "0"
TextBox7.Text = "0"
TextBox8.Text = "0"
...
...
TextBox99.Text = "0"
TextBox100.Text = "0"
Is there a more intelligent way to do this, instead of repeating the same code a lot of times?
Thanks for any idea...
Michel Jr.
-
Jul 31st, 2000, 03:06 PM
#2
transcendental analytic
You could make an array of textboxes, just name them the same and set a individual index to each:
Code:
Dim a As TextBox
For Each a In Text1
a = 0
Next a
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 31st, 2000, 03:09 PM
#3
Addicted Member
If your problem is solely on Text Boxes, you should use a control array. When creating your textboxes, you create one, copy and paste it... VB will create the array for you.
Then, you can scroll through it just as Text1(i).Text = "0"
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
|