Results 1 to 5 of 5

Thread: OptionButton SetFocus Problem

  1. #1

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    I have an OptionButton on the second tab of an SSTab control. The initial value of the OptionButton is False. When the user clicks the tab that contains the OptionButton, I'd like to set the focus to that OptionButton, but when I do the OptionButton's value is automatically set to True and I don't want that to happen. Any ideas on how to change that behavior?

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    a shot in the dark
    On Focus of whatever optWhatever.Value = False
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    Thamks, but that was the first thing I tried. If I SetFocus and then the Value to False it loses focus. If I Set the Value to False and then setfocus, the Value is set to True. If I don't do anything, the focus is not set.

  4. #4
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    This seems to work for me:

    Code:
    Option Explicit
    
    Private Sub Option1_GotFocus()
        Option1.Value = False
    End Sub
    
    Private Sub SSTab1_Click(PreviousTab As Integer)
        Option1.SetFocus
    End Sub

  5. #5

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