Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 3rd, 2003, 04:11 PM
Authorized User
 
Join Date: Jul 2003
Location: Dallas, TX, USA.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to yossarian Send a message via AIM to yossarian Send a message via MSN to yossarian Send a message via Yahoo to yossarian
Default Trapping the Shift key

I'm having trouble with trapping the Shift key in the KeyDown or KeyPress event of a combobox. I want to ignore the key. Any help or guidance is appreciated. Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old July 6th, 2003, 02:00 PM
Authorized User
 
Join Date: Jul 2003
Location: Reading, Berkshire, United Kingdom.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alex_read
Default

For another time, each character on your keyboard has a corresponding ascii number value of the key - i.e. in ascii, the letter A is equivalent to 65, B to 66 etc.

Typing in msgbox keycode under the combobox_keypress event will give you the number of the key you're testing, which you can then place into an if statement to check against like this...
Code:
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode <> 32 Then
        MsgBox "The key " & Chr(KeyCode) & " was pressed!"
    End If
End Sub
Reply With Quote
  #3 (permalink)  
Old July 7th, 2003, 08:03 PM
Authorized User
 
Join Date: Jul 2003
Location: Dallas, TX, USA.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to yossarian Send a message via AIM to yossarian Send a message via MSN to yossarian Send a message via Yahoo to yossarian
Default

I've got that part -- the keycode is 16 that I test. The problem is that even when setting the keycode to 0, it still doesn't disable the Shift key. Any Ideas?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable the [SHIFT Key] on Startup ru1 Access 4 September 22nd, 2007 09:27 PM
Help: Disable the "Shift Key" on macro Auto run ofAlexander Word VBA 1 June 24th, 2007 03:16 AM
shift from vb to c# noman77 .NET Framework 2.0 1 October 14th, 2004 08:15 AM
Shift + Enter OR Shift+Double-Click phungleon Access 2 May 20th, 2004 10:14 AM
Enable Shift Key to By Pass Macro! sampow Access 1 December 4th, 2003 07:46 PM



All times are GMT -4. The time now is 08:03 PM.


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