Results 1 to 3 of 3

Thread: [RESOLVED] SaveAllSettings w/ Ctrl Array?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    372

    Resolved [RESOLVED] SaveAllSettings w/ Ctrl Array?

    how could i make a control array to save all the settings on a form.
    it is mostly options, so i would imagine
    if type of x is option then savesetting (yadda yadda)

    my question is what is the actual wording i need for this.
    i need to store the values of the options, text of textboxes, and position of a scrollbar.

    is there any way to automate this without having 30 lines of savesettings?

    just a short example that would iterate all options would set me in the right direction.

    thanks!

  2. #2
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: SaveAllSettings w/ Ctrl Array?

    Something like this?
    VB Code:
    1. Private Sub SaveAllSettings()
    2.     Dim ctl As Control
    3.     For Each ctl In Me.Controls
    4.         Select Case True
    5.             Case TypeOf ctl Is OptionButton
    6.                 ' Save Option Settings
    7.             Case TypeOf ctl Is TextBox
    8.                 ' Save Text
    9.             Case TypeOf ctl Is VScrollBar, TypeOf ctl Is HScrollBar
    10.                 ' Save scrollbar
    11.         End Select
    12.     Next ctl
    13. End Sub

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    372

    Re: SaveAllSettings w/ Ctrl Array?

    works a charm.

    thanks!

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