Results 1 to 4 of 4

Thread: Option buttons

  1. #1

    Thread Starter
    Addicted Member Guru's Avatar
    Join Date
    May 2000
    Location
    sulking in the cupboard under the stairs
    Posts
    237

    Option buttons

    I want a set of option buttons on a form with NONE selected

    When the form loads the first option is always selected
    doing this:
    Code:
    Option Explicit
    
    Private Sub Form_Activate()
    Option1(0).Value = False
    End Sub
    will unset it but If I then minimize the form it becomes set again when I restore it.
    Another light-hearted post from Guru

  2. #2
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    When you put the option buttons on the form, make sure none of them have the Value set to True.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  3. #3

    Thread Starter
    Addicted Member Guru's Avatar
    Join Date
    May 2000
    Location
    sulking in the cupboard under the stairs
    Posts
    237

    Re: Well ...

    Originally posted by honeybee
    When you put the option buttons on the form, make sure none of them have the Value set to True.

    .


    Did you try this?




    I've worked out what the problem is now anyway

    If you have another control with a lower tab index , it gets focus on form load and the option buttons remain unset

    If the form ONLY has option buttons on it one of them gets set

    The way round it is to have the opytion buttons on a frame (which I did have anyway) and hide a command button behind it.
    Another light-hearted post from Guru

  4. #4
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    Or set the TabStop property to False, but then you wouldn't be able to tab into them. Yes, I realize now the focus could select a button.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

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