Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: Puzzle on March 08, 2004, 01:21 PM

Title: alt + <anykeyhere> beep error
Post by: Puzzle on March 08, 2004, 01:21 PM
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.
Title: Re:alt + <anykeyhere> beep error
Post by: Stealth on March 08, 2004, 01:53 PM
Set the KeyAscii value to 0 when you're finished with it.
Title: Re:alt + <anykeyhere> beep error
Post by: Puzzle on March 08, 2004, 02:12 PM
that doesn't work when alt is the shift key
Title: Re:alt + <anykeyhere> beep error
Post by: Stealth on March 08, 2004, 04:58 PM
Quote from: Puzzle on March 08, 2004, 02:12 PM
that doesn't work when alt is the shift key

Post some code?
Title: Re:alt + <anykeyhere> beep error
Post by: Puzzle on March 08, 2004, 05:59 PM

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


Edit: pasted wrong code
Title: Re:alt + <anykeyhere> beep error
Post by: Stealth on March 09, 2004, 05:44 PM
Try this;


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
Title: Re:alt + <anykeyhere> beep error
Post by: Newby on March 09, 2004, 06:23 PM
Quote from: Stealth on March 09, 2004, 05:44 PM
Try this;


   Shift = 0 '// setting both of them perhaps?


Somebody wants to feel like they're coding in a langauge other then Visual Basic. ^^
Title: Re:alt + <anykeyhere> beep error
Post by: Puzzle on March 09, 2004, 07:11 PM
I tried that also :-\