No announcement yet.

how to make an active button invisible in a dialog?

  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Quick look at your code shows you create a "hidden" button with %WS_CHILD OR %WS_TABSTOP OR %BS_OWNERDRAW style. Remove %WS_TABSTOP so it only has %WS_CHILD OR %BS_OWNERDRAW styles and tabbing to next control problem will be solved.

    Added - another tip could be to add %MB_TOPMOST style to MSGBOX, so it doesn't end up under dialog 2 there in some cases, like %MB_OK OR %MB_TOPMOST.

    Added 2: But like others have replied - easier and best way is via message directly, instead of hidden button. I just wanted to show how to fix tab-to-control problem.


    • #22
      Stopping use of the tab key in your app is most definitely *not* what you want to do. There are folks who (for various reasons) don't use a mouse. In some cases, it's because they're using a screen reader because they can't see the screen. In that caxe specifically, and other cases in general, removing keyboard navigation of an app can make it completely inaccessible, and unusuable to many folks. Plus, there are folks who do use a mouse, but resort to keyboard usage to make things faster. It's way faster to press a key or two then to move the mouse all over the screen especially if it's being used for something that requires the mouse to be somewhere else on the screen when they wish to accomplish something else. There's all kinds of reasons *not* to disable the tab key. But, it's your program, and you can do with it what you like, but just for reasonable advice, one should *never* disable the tab key, as it's an essential tool for many users.]

      for hosting/internet



      • #23
        Originally posted by Travis Siegel View Post
        Stopping use of the tab key in your app is most definitely *not* what you want to do..
        He didn't ask about disabling the tab key for the application.
        He just wanted to "disable the tab keys for this hidden button"
        IOW, he did not understand the effect of the %WS_TABSTOP style in his code.