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?
Printable View
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?
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.
Yes you can add and remove controls at run time. Give me a few and i'll make you a working example.
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
Thanks Arc