CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2001
    Posts
    49

    SSTab on ActiveX control and cmdButton.Cancel =True doesn't work

    I have a SStab on an UserControl. The UserControl has DefaultCancel = True. Now when you drop that UserControl on a dialog box. The Cancel button on the dialog box has the property Cancel = True.

    The Usercontrol has a number of other objects on it. If the focus is on any object even on objects inside the tab, pressing the escape key will work. If the focus is on one of the tabs (of the SSTab,) pressing escape key doesn't do anything. QA and Product management wants it work. How do I do that?


  2. #2
    Join Date
    Dec 2001
    Posts
    6,332

    Re: SSTab on ActiveX control and cmdButton.Cancel =True doesn't work

    It should be easy enough by setting the KeyPreview property for your control to true. Your control will then receive the keystrokes before any controls in it.

    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

  3. #3
    Join Date
    Sep 2001
    Posts
    49

    Re: SSTab on ActiveX control and cmdButton.Cancel =True doesn't work

    Thanks for the help. However it didn't quite work. So I tried something else that solved the problem for reason unknown to me. If you add a underscore making it a hot key (with &) on the tabs caption. It will work. Without the underscore, it doesn't.


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