Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics 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 29th, 2003, 09:59 PM
Authorized User
 
Join Date: Oct 2003
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default Navigation keys

I have been going round in circles trying to use navigation keys in an application I am writing. Simply put, I would like to be able to execute certain code when a navigation key is pressed. Any help would be greatly appreciated!
 
Old November 2nd, 2003, 05:00 PM
Authorized User
 
Join Date: Oct 2003
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Not sure how efficient this code is, but it works...


Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        Dim keyInformation As KeyEventArgs = e
        Select Case keyInformation.KeyCode()
            Case Keys.Left
                lblMessage.Text = "Left"
            Case Keys.Right
                lblMessage.Text = "Right"
            Case Keys.Up
                lblMessage.Text = "Up"
            Case Keys.Down
                lblMessage.Text = "Down"
            Case Else
                lblMessage.Text = ""
        End Select
    End Sub






Similar Threads
Thread Thread Starter Forum Replies Last Post
usernames as keys JoeFuture BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 June 5th, 2006 07:02 AM
When to define primary keys and foregin keys? method SQL Server 2000 1 August 26th, 2005 09:14 AM
Hot Keys Louisa VB.NET 2002/2003 Basics 6 September 27th, 2004 09:48 AM
Modifier Keys shadowpug VB.NET 2002/2003 Basics 2 March 31st, 2004 12:20 PM
foreing keys ? ptesone MySQL 1 January 10th, 2004 10:06 AM





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