Is this possible?

Discussion in 'AutoCAD' started by Dave F, Jan 14, 2004.

  1. Dave F

    Dave F Guest

    Hi
    a2k2

    I have a form with numerous option buttons.
    I want to save the last active optionbutton in the registry so that when I
    run the routine again I can set it as current.

    At the moment, I'm storing a text string representing the optionbutton &
    using Select Case to test for the value.

    Is there a way to store the actual title of the optonbutton in the registry
    & read it into a variable so that the desired button is directly set as
    active

    Something Like this (I realise it won't work):

    Set OptButVar as String
    OptButVar = GetSetting("fxsteel", "baa_bh", 1)
    OptButVar.Value = True

    TIA
    Dave F.
     
    Dave F, Jan 14, 2004
    #1
  2. Dave F

    Tim Arheit Guest

    You use the controls collection on the form to loop though all the
    option buttons until you find one with the correct name.

    Alternately you could use a control array for all your option buttons
    and simply save the index fo the option button that is selected.

    -Tim
     
    Tim Arheit, Jan 14, 2004
    #2
  3. Dave F

    Tim Arheit Guest


    It's also possible to do Controls("name").Value = Getsetting(...)

    -Tim
     
    Tim Arheit, Jan 14, 2004
    #3
  4. Dave F

    thenrich01 Guest

    I think you could use the CallByName function to accomplish your goal
     
    thenrich01, Jan 14, 2004
    #4
  5. Dave F

    Michel Guest

    Hi Dave,
    You can use "SaveSetting" to save your option button value to a registry-key and "GetSetting" the next time to get your value from the register. You can use your optionbutton name als the registry-keyname.
    Also look in the Help-file.

    good luck
    Michel
     
    Michel, Jan 15, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.