dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Problem with the handling of ESC key in textbox control

Hybrid View

  1. #1
    Join Date
    Mar 2004
    Posts
    1

    Problem with the handling of ESC key in textbox control

    Hi,

    I am facing a problem with the handling of ESC key in user controls
    created in VB.

    I have a multiline text box in the control. Also the text box is enabled
    since I have to select/copy text in it.

    Next I place the control in an MFC dialog. I do not need OK and Cancel
    buttons on it and so I remove them and the corresponding handlers. Now,
    when I click in the text box and then press ESC key, the text box
    disappears and the application crashed.

    Strangely, when I used the control in a VB form this problem was not
    occuring.

    I am using VB 6.0 and VC++ 6.0.

    If any can let me know how this may be resolved with VC++, it is greatly
    appreciated.

    Thanks in Advance
    Patil

  2. #2
    Join Date
    Mar 2004
    Location
    UK
    Posts
    188
    VB doesn't create proper system DLL's like C++ does and they can only be used in the VB environment. If you wnat to use a control in both environments then you will need to create it in VC++.

    Nick

  3. #3
    Join Date
    Dec 2001
    Posts
    6,332
    I wonder if setting the KeyPreview property of the control to True will let you catch the escape key and prevent the problem. My guess is that it won't. However, suppose you change the window style of the dialog to eliminate the "X" button? Won't it then not respond to the escape key?
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)