Wrox Programmer Forums
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 28th, 2003, 09:31 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default KeyUp doesn't work on Form


I can't get a KeyUp event to trigger on a form. It's defined as:
Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp

End Sub
I can't get it to trigger (have a breakpoint on it) when I press a key with the form active. There is no MDI parent for this form yet (does that matter?). Any ideas? I have a datagrid on the form, and the keyup event works for that...


Brian Mains
Old October 28th, 2003, 10:04 AM
Authorized User
Join Date: Jun 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Brian

Have you set the keypreview property for the form, key up, key down etc works for controls without this property being set but the form must have key preview set to true before it will recognise any key events.


Old June 5th, 2005, 05:24 AM
Registered User
Join Date: Jun 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

I just registered here to let you know that you post was very helpful to me. Thanks a lot!

Writing software to specification and walking on water is easy.. as long as both are frozen.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form and SubForm stop work lijandra Access VBA 0 August 16th, 2006 12:48 PM
update/insert work in queries but not on form jonicholson Access VBA 3 January 18th, 2005 06:05 PM
With SendInput, KEYEVENTF_KEYUP makes no keyup EMHmark7 Pro VB.NET 2002/2003 0 November 22nd, 2004 05:56 PM
Capturing Keyup & KeyDown in a Datagrid SupaHoopsa General .NET 3 October 11th, 2004 03:40 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.