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

    Why don't edit boxes support CTRL-X, CTRL-C, CTRL-V?

    I like to use Ctrl keys for cut, copy, and paste. Why don't edit boxes on forms support these functions?


  2. #2
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: Why don't edit boxes support CTRL-X, CTRL-C, CTRL-V?

    They support accelerators as you can see for example in a dialog box.
    All CTRL+X,V,C, or the SHIFT-DELETE, SHIFT-INSERT, CTRL-INSERT, CTRL-DELETE will work as usual.
    The difference is that dialog does not have Edit menu therefore for edit operations are processed "normal" way using windows acceleration processing.
    Class wizard adds Edit menu to your application but there is no handlers for any edit operation therefore menu is disabled (grayed). Furthermore application menu gets acceleration keys, not edit controls.
    It is not difficult to fix it.
    Using class wizard insert both command handlers and update command handlers for edit command you want to support.
    In update command handlers enable command only if any edit control has a focus and disable other vice.
    In command handlers check, which edit control has focus and call appropriate function: cut, copy and paste.
    This will allow accelerators work properly.
    If you have problem let me know; I can send you my sample.




    I don't do it for ratings. However, rating tells me how my solution worked and that is important.
    Good luck in your journey in a C++ land.

    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  3. #3
    Join Date
    Aug 2013
    Posts
    1

    Re: Why don't edit boxes support CTRL-X, CTRL-C, CTRL-V?

    HI I am facing same problem . Can u please post sample program
    for how to enable ctrl v and ctrl c for textbox in VC++

    Thank U

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: Why don't edit boxes support CTRL-X, CTRL-C, CTRL-V?

    Victor Nijegorodov

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