Register for your free account! | Forgot your password?

You last visited: Today at 04:27

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[VB2008]

Discussion on [VB2008] within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2009
Posts: 111
Received Thanks: 13
[VB2008]

Sorry that "no" Topic was given : Topic should be : Get Keypress with Modifier
(Perhaps mod can change, thanks)

Hello all,

I have a "Text Box" in which a user has to enter a HotKey for a special action in game.

The Hotkey can be any combination from (one)number, (one)letters with or without Shift or Ctrl or Alt.

My problem is to get what was entered if a modifier key is presst.

e.g. :

User enters "!" and I want to display "SHIFT + 1" in the textbox
same with ALT or CTRL

I have this code to get the modifier:

Code:
Private Sub txtHPTKey_Keydown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtHPTKey.KeyDown


        If (Control.ModifierKeys And Keys.Shift) = Keys.Shift Then txtHPTKey.Text = "SHIFT + "
        If (Control.ModifierKeys And Keys.Control) = Keys.Control Then txtHPTKey.Text = "CTRL + "
        If (Control.ModifierKeys And Keys.Alt) = Keys.Alt Then txtHPTKey.Text = "ALT +"


    End Sub
Can anybody please help how I can solve "my problem" ?

Thanks.

Maxxx.

* SOLVED * :

Code:
 Private Sub txtHPTKey_Keyup(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtHPTKey.KeyUp

        If (Control.ModifierKeys And Keys.Shift) = Keys.Shift Then txtHPTKey.Text = "SHIFT + " & Convert.ToChar(e.KeyCode)
        If (Control.ModifierKeys And Keys.Control) = Keys.Control Then txtHPTKey.Text = "CTRL + " & Convert.ToChar(e.KeyCode)
        If (Control.ModifierKeys And Keys.Alt) = Keys.Alt Then txtHPTKey.Text = "ALT + " & Convert.ToChar(e.KeyCode)
        e.Handled = True
maxxx69de is offline  
Reply


Similar Threads Similar Threads
[VB2008] 32bit und 64bit
02/23/2010 - .NET Languages - 3 Replies
Ich stehe vor einem Problem und komme nicht weiter. Für einen Bot wolle ich ein kleines Modul zwecks Texterkennung mit einbauen. Das Bot-Programm läuft nur unter 64bit OS und auch nur, wenn ich bei VB2008 in den Compiler-Einstellungen "Any CPU" auswähle. Den Teil mit ScreenShot/Texterkennung wollte ich erstmal extra testen und das geht wiederrum nur, wenn ich es mit den Einstellungen "32 bit CPU" compile. Hab keine Möglichkeit gefunden, beides zu kombinieren.
Hilfe für VB2008
01/25/2010 - .NET Languages - 3 Replies
Hey Liebe Com. Habe mahl eine Frage zu Vb2008, bei Großen Programmen wie z.b. Firefox Oder Vb2008 habe immer ein Logo (siehe Bild) und meine Frage dazu ist wie füge ich in Vb2008 ein solches ein?? C:\Dokumente und Einstellungen\Admin\Desktop\Meine Ordner\Wallpaper/Unbenannt
[How To] Loginsystem mit VB2008
11/12/2009 - Tutorials - 17 Replies
Hallo leute, ich zeige euch heute wie man mit Visual Basic 2008 ein login System machen kann. Ihr Braucht dazu: Visual Basic 2008 Ich Uploade auch gleich ein Video Dazu
[Tut]VB2008 Login
09/26/2009 - Coding Tutorials - 14 Replies
Hi Leute, Ich erkläre euch heute wie ihr ein Login (für Passwörter) Bei Visual Basic 2008 erstellt. Nunja ok dann mal los, ne ;-) _________________________________________________ _____________ Info: Ihr könnt euch natürlich alles anders einrichten ^^, is jetz nur so gemacht und auch die namen anders nennen^^ _________________________________________________ _____________ So ok also als erstes erstellt ihr euch eine Form namens Login http://www.bilder-upload.eu/thumb/mO40mN56446jmAX .jpg
VB2008 und Silkroad???
04/25/2009 - Silkroad Online - 6 Replies
Hi erstmal^^ Ich würde gerne ein Programm machen womit die Server stats von dem Server "Sparta" in einer label angezeigt werden. Nur ich hab keine ahnung wie ich das anstellen soll^^ Könnt ihr mir bitte helfen ?



All times are GMT +2. The time now is 04:27.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.