|
-
Feb 22nd, 2002, 09:35 PM
#1
Control Array Help
I have a control array but I would like to make it dynamic based on a slider control value(from 1-20).
what I would like to do is each time the procedure is called is to get the value of the slider and readjust the array count is this possible?
-
Feb 22nd, 2002, 09:53 PM
#2
I don't know if you can actually adjust the upper limit of elements in a control array at run time, but you can simply display only as many as you need at run time.
-
Feb 22nd, 2002, 10:10 PM
#3
PowerPoster
Yes you can add and remove controls at run time. Give me a few and i'll make you a working example.
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

-
Feb 22nd, 2002, 10:33 PM
#4
PowerPoster
OK this is just a basic example... i'll let you work out the math to get it just right but this is how you add controls and get rid of control but scrolling up and down a Scroll bar.
Add a textbox to a form named text1 and set its index to 0
VB Code:
Private Sub VScroll1_Change()
On Error Resume Next
Text1(0).top=0
Text1(0).Left=0
Load Text1(VScroll1.Value)
If Text1(VScroll1.Value).Visible = False Then
Text1(VScroll1.Value).Visible = True
Else
Text1(VScroll1.Value).Visible = False
End If
Text1(VScroll1.Value).Top = Text1(0).Top + Text1(0).Height * VScroll1.Value
End Sub
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

-
Feb 22nd, 2002, 11:35 PM
#5
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
|