Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

Key Handling, Alt+Down Arrow

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jason - 14 Oct 2004 13:55 GMT
hi,

I need to trap combination keys Alt+DownArrow in KeyDown events, but without
any success.   Here is the code :

private void myTextBox_KeyDown(object sender, KeyEventArgs e)

{

if(e.KeyCode == Keys.Down && e.Alt)

{

MessageBox.Show("Pressed");

}

}

Thanks.
Morten Wennevik - 14 Oct 2004 15:13 GMT
Hi Jason,

Your code should work.  Could you provide us with a small but complete  
sample of your code?

Signature

Happy Coding!
Morten Wennevik [C# MVP]

Herfried K. Wagner [MVP] - 14 Oct 2004 15:43 GMT
"jason" <llkhor@excite.com> schrieb:
> I need to trap combination keys Alt+DownArrow in
> KeyDown events, but without any success.   Here is the code :
[quoted text clipped - 4 lines]
>
> if(e.KeyCode == Keys.Down && e.Alt)

Try this:

\\\
if ((e.KeyCode == Keys.Down) && ((Control.ModifierKeys & Keys.Alt) ==
Keys.Alt))
   ...;
///

Signature

Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/

jason - 18 Oct 2004 06:50 GMT
The code works only if textbox's parent is a form.

It does not work if textbox is a child control of DataGridColumnStyle.

Thanks.

> "jason" <llkhor@excite.com> schrieb:
>> I need to trap combination keys Alt+DownArrow in
[quoted text clipped - 13 lines]
>    ...;
> ///

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.