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

    Checking if Control is held

    Hi All,

    When dealing with a tree view control, is it possible to check if the user is holding down the control key when they click on a node?

    Ive noticed that the treeview does not allow the highlighting on multiple node so im going to implement it myself, however ctrl+click is the standard way of selecting multiple items in windows and I would like it to remain as such in my application (for ease of learning how to use it etc)

    If it is not possible to check for CTRL, is it possible to check for a keystroke?

    for example, the user clicks on a node and then presses a key, node becomes highlighted.

    It might be worth mentioning ill implement highlighting by adjusting the back colour not trying to actually select multiple nodes (im looking for a quick fix).

    Thanks in advance for you help

    Rich.

  2. #2
    Join Date
    Nov 2002
    Location
    Baby Land
    Posts
    646

    Re: Checking if Control is held

    Just handle the KeyDown event and check e.Control parameter value to see whether the control key is pressed or not

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