Results 1 to 5 of 5

Thread: Control Array Help

  1. #1
    egiggey
    Guest

    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?

  2. #2
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,526
    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.

  3. #3
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    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.


  4. #4
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    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:
    1. Private Sub VScroll1_Change()
    2. On Error Resume Next
    3. Text1(0).top=0
    4. Text1(0).Left=0
    5. Load Text1(VScroll1.Value)
    6. If Text1(VScroll1.Value).Visible = False Then
    7. Text1(VScroll1.Value).Visible = True
    8. Else
    9. Text1(VScroll1.Value).Visible = False
    10. End If
    11. Text1(VScroll1.Value).Top = Text1(0).Top + Text1(0).Height * VScroll1.Value
    12. 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.


  5. #5
    egiggey
    Guest
    Thanks Arc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width