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 / .NET Framework / New Users / November 2006

Tip: Looking for answers? Try searching our database.

Key repetition

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Romain TAILLANDIER - 22 Nov 2006 15:27 GMT
Hi group

I have a control looking like a TrackBar, a bar, with a cursor.
I need when the user push the left arrow of his keyboard, the cursor
move left until the key released.
I have overloaded the OnKeyDown method like this :

protected override void OnKeyDown(KeyEventArgs e)
{
    base.OnKeyDown(e);

    switch(e.KeyCode)
    {
        case Keys.A :
            this.SelectedBlock--;
            break;
        default:
            break;
    }
}

It work very good with the A Key, but the event for left arrow doesn't
fire !
only the OnKeyUp is fired by the Left Arrow key.

I can't implement the repetition keystroke for arrows, or control,
shift ....

However, the ListView control for exemple allow me to scroll all the
list by push the down arrow, without release it.

How to make the repetition of the left arrow key ?
Thanks

ROM
Gabriele G. Ponti - 22 Nov 2006 16:42 GMT
Read the Remarks section of the Control.KeyDown event.

If you're using 2.0 you can try the Control.PreviewKeyDown event, from a
quick test it seems to be working with the arrow keys.

> Hi group
>
[quoted text clipped - 31 lines]
>
> ROM

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.