Hot key, Shortcut key, ??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?UmF5IE1pdGNoZWxs?=

    Hot key, Shortcut key, ??

    Hello,

    I have a textbox containing a listview of items. I would like to set it up
    so that when that textbox has the focus and I press ctl-A from the keyboard
    it selects all the items. Dealing with the textbox and selecting the items
    is not the issue here since I can readily do that. However, how do I set
    everything up to know that ctl-A has been pressed? Also, what is the correct
    name for such a key? Is it called a hot key, a shortcut key, or what?

    Thanks,
    Ray
  • Peter Duniho

    #2
    Re: Hot key, Shortcut key, ??

    On Thu, 25 Sep 2008 13:33:00 -0700, Ray Mitchell
    <RayMitchell_NO SPAM_@meanoldte acher.comwrote:
    Hello,
    >
    I have a textbox containing a listview of items. I would like to set it
    up
    so that when that textbox has the focus and I press ctl-A from the
    keyboard
    it selects all the items.
    For a control that has the focus, handling the KeyPress event would
    normally be sufficient for your needs. In the event handler, you can do
    whatever action should happen at that time.

    For certain kinds of objects, they handle shortcut keys internally, based
    on properties set (e.g. menus that have menu items with specific keys, or
    buttons that have an accelerator key specified in the button text), but
    for a text box you'll have to do this yourself.

    Honestly, your description of "a textbox containing a listview of items"
    is somewhat confusing. I mean, all Control instances can have child
    controls, but it's not something one would typically do with a TextBox
    instance. But regardless, hopefully the above provides the information
    you need.

    Pete

    Comment

    Working...