CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2002
    Posts
    4

    Question How can I include a toolbar in the tab order of a dialog box?

    Hello,

    I create several toolbars in the WM_INITDIALOG handler of a modal dialog box.

    Although the toolbars have WS_TABSTOP style set, I cannot include them in the tab order. That is, when navigating among dialog box controls with TAB key the toolbars never get the focus.

    What should I do to enable tabstop for the toolbars (and eventually for the toolbar buttons, although I would be happy also to get to the toolbar with TAB key and then navigate inside the toolbar with arrow keys) ?

    Thank you.
    Last edited by stefan_tzanev; February 14th, 2003 at 04:24 PM.

  2. #2
    Join Date
    Sep 2002
    Location
    Ukraine, Kiev
    Posts
    19

    Toolbars

    There is no way to do that. I've never seen it so I think toolbars doesn't support that feature.

  3. #3
    Join Date
    Dec 2001
    Location
    Ontario, Canada
    Posts
    2,236
    well, there is a way. You could implement your own custom tabbing. Basically you would override PreTranslateMessage() to catch the tab key then set focus to the next window in the tab order. It not very hard to do.

  4. #4
    Join Date
    Jun 2002
    Posts
    4
    Originally posted by mwilliamson
    well, there is a way. You could implement your own custom tabbing. Basically you would override PreTranslateMessage() to catch the tab key then set focus to the next window in the tab order. It not very hard to do.
    Thanks to both v0id and mwilliamson for the replies.

    Unfortunately, I have the feeling that the toolbar ctrl is implemented by rendering the button bitmaps and then tracing the mouse position and generating notifications to the parent. If this is true, this makes it impossible to set the focus on any of the buttons or to navigate among them - these buttons simply don't exist. This idea came to my mind after realizing that the toolbar ctrl does not need a bitmap that represents the "has focus" state of the buttons - there are bitmaps only for up, down, disabled and "mouse pointer over" states.

    So, maybe I'll just give up the idea of navigating among the tb buttons, or I'll switch to bitmap buttons instead.

    Thank you, anyway.

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

Featured