Valhalla Legends Forums Archive | Visual Basic Programming | alt + <anykeyhere> beep error

AuthorMessageTime
Puzzle
Ok, I've been working on this almost all day and can't seem to find any documentation on how to stop the keypress handlers from causing the beep after the keystroke has been processed.

From what I've researched the only way to stop this is to have the character as a menu shortcut which would defeat the purpose of what I'm trying to do.

The purpose of this is going to be adding the slected username in the listview to the textbox.
March 8, 2004, 7:21 PM
Stealth
Set the KeyAscii value to 0 when you're finished with it.
March 8, 2004, 7:53 PM
Puzzle
that doesn't work when alt is the shift key
March 8, 2004, 8:12 PM
Stealth
[quote author=Puzzle link=board=31;threadid=5669;start=0#msg48374 date=1078776760]
that doesn't work when alt is the shift key
[/quote]

Post some code?
March 8, 2004, 10:58 PM
Puzzle
[code]
Private Sub lwRoomUsers_KeyDown(KeyCode As Integer, Shift As Integer)

If Shift = 4 Then
If KeyCode = 78 Then
With frmMain.txtSend
.text = .text & frmMain.lwRoomUsers.SelectedItem.text
.SetFocus
.SelStart = Len(.text)
End With
End If
End If
KeyCode = 0
End Sub
[/code]

Edit: pasted wrong code
March 8, 2004, 11:59 PM
Stealth
Try this;

[code]
Private Sub lwRoomUsers_KeyDown(KeyCode As Integer, Shift As Integer)

If Shift = 4 Then
If KeyCode = 78 Then
With frmMain.txtSend
.text = .text & frmMain.lwRoomUsers.SelectedItem.text
.SetFocus
.SelStart = Len(.text)
End With
End If

KeyCode = 0
Shift = 0 '// setting both of them perhaps?
End If
End Sub
[/code]
March 9, 2004, 11:44 PM
Newby
[quote author=Stealth link=board=31;threadid=5669;start=0#msg48615 date=1078875897]
Try this;

[code]
Shift = 0 '// setting both of them perhaps?
[/code]
[/quote]

Somebody wants to feel like they're coding in a langauge other then Visual Basic. ^^
March 10, 2004, 12:23 AM
Puzzle
I tried that also :-\
March 10, 2004, 1:11 AM

Search