Results 1 to 4 of 4

Thread: detecting CTRL+A in a user control?

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    detecting CTRL+A in a user control?

    Havent used .NET in a while...forgetting everything i cant even get the keydown even

    How can i detect CTRL+A key combo in a user control? (some other control inside the user control might have focus)
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: detecting CTRL+A in a user control?

    You'd need to handle the KeyDown of each child control, probably all with the one method.
    CSharp Code:
    1. if (e.Control && e.KeyCode == Keys.A)
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: detecting CTRL+A in a user control?

    hey thanks
    I'm trying to use this on a list box to select all items
    I'm kind of confused. After detecting CTRL+A i select all items in a listbox and then set e.Handled to true.... but if there is an item that starts with "A" in the listbox, it deselects everything and then only select the first item that starts with A


    shouldnt e.handled = true stop it from selecting the item whose text starts with 'A' ?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: detecting CTRL+A in a user control?

    Is the KeyDown event being fired twice?

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