|
-
Jun 5th, 2000, 10:16 PM
#1
Thread Starter
Addicted Member
first, if possible, how would i make a textbox scrollable, but the user cannot edit the text? Enable disables the entire textbox including the scroll, what should i do?
also, i have this code:
Random = Int(Rnd * 25)
now, i have 25 different command buttons, i want, when random selects a command, for the program to run the code that is associated with clicking the button.......
Random = Int(Rnd * 25)
Command(Random).???????????????
what should i do? Thanks much for all your help!
-
Jun 5th, 2000, 10:20 PM
#2
Addicted Member
1. Set the TextBox 'Locked' property to 'True'.
Not proper code - sort of a flow diagram...:-
If RandomNumber=1 then Command1_Click
If RandomNumber=2 then Command2_Click
...and so on...
...but with 25 different possibilities, you might be better using Select...Case. Look it up in MSDN.

-
Jun 5th, 2000, 10:22 PM
#3
Fanatic Member
Try
Text1.Locked = True
and
Command(Random).Value = True
Iain, thats with an i by the way!
-
Jun 5th, 2000, 10:37 PM
#4
Fanatic Member
If you have a single command button named Command, for example, you would call its Click event like this:
If you have a control array -- from your post, it seems to be the case:
Code:
Command_Click(Random)
where Random is your random number. You can then use a Select Case .. End Select statement block to take action inside the button array's event handler.
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
|