Focus on a Command Button in VB6
Results 1 to 8 of 8

Thread: Focus on a Command Button in VB6

  1. #1
    Junior Member
    Join Date
    Apr 2001
    Location
    UK
    Posts
    5

    Post Focus on a Command Button in VB6

    A doted border in a command button indicates
    it has focus when it is clicked, right?...My problem is that I dont want the command button to show it has focus.

    So can anyone tell me how to prevent the dotted border appearing in the command button when it is clicked?

    Thanks.

  2. #2
    Registered User
    Join Date
    Dec 2000
    Location
    Circle Pines,MN,USA
    Posts
    805

    Post

    I don't know...make a seperate picture you can click on or something
    ...

    why wouldn't you want that on a button?

  3. #3
    Registered User
    Join Date
    Dec 2000
    Location
    Circle Pines,MN,USA
    Posts
    805

    Post

    create a picture that has no 3d properties.


    then put that in the right spot. I don't know how else to do it.
    Private Sub Command1_Click()
    Picture1.SetFocus
    End Sub

  4. #4
    Junior Member
    Join Date
    Apr 2001
    Location
    UK
    Posts
    5

    Smile

    Originally posted by LagMonster:
    I don't know...make a seperate picture you can click on or something
    ...

    why wouldn't you want that on a button?
    I'm developing a memory game where I don't want the user to have a visual reference to where they last clicked.

    I was hoping there was a property or combination of properties that avoided using a redundant control to distract the focus from the command button.

    Thanks anyway.

  5. #5
    Registered User
    Join Date
    Dec 2000
    Location
    Circle Pines,MN,USA
    Posts
    805

    Post

    Would a picture box work for you?

  6. #6
    Junior Member
    Join Date
    Apr 2001
    Location
    UK
    Posts
    5

    Thumbs up

    Originally posted by LagMonster:
    Would a picture box work for you?
    As a replacement for the command button or to distract focus from the command button?

    If you mean as a replacement, I prefer the characteristics that a command button has(If the user knows where to click, thats half the battle won).

    If you mean as a distraction...the picture.setfocus in the command_click procedure definately does the job.

    Thanks.

  7. #7
    Registered User
    Join Date
    Dec 2000
    Location
    Circle Pines,MN,USA
    Posts
    805

    Post

    Sorry I don't know the direct approach, but I am glad that you have it working the way you want.

  8. #8
    Junior Member
    Join Date
    May 2001
    Location
    kuwait
    Posts
    6

    Talking

    You can add in your ON CLICK event to move focus to another hidden object that will not show tha last location of the cursor or focus by:
    [object].setfocus

Bookmarks

Posting Permissions

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