| View previous topic :: View next topic |
| Author |
Message |
TheIndianGuy Advanced Cheater
Reputation: 102
Joined: 14 Jan 2007 Posts: 88
|
Posted: Thu Aug 23, 2007 4:03 pm Post subject: here is your answer noob attack |
|
|
ok i figured out how to do it.
make sure you put this code into your form and change the method to keydown. also make sure to change the keypreview to true on the properties window.
| Code: | if e.keycode = keys.a and e.modifiers = keys.control then
messagebox.show("hello world")
e.handled = true
end if |
thats just an example with a messagebox now you figure out how to do it with a button
edit: here is how to do it with a button i guess i will give you the answer this time
create a button, lets use crtl+A again
so on form1 make sure keypreview = true
| Code: | Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.H And e.Modifiers = Keys.Control Then
Button1.Select()
e.Handled = True
End If
End Sub |
| Code: | Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello World")
KeyPreview = True
End Sub | this is if the user wants to click the button it shows the message hello world
| Code: | Private Sub Button1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Button1.KeyPress
MessageBox.Show("Hello World")
KeyPreview = True
End Sub | this is so if the user wants to press crtl+a to show the message hello world
now you have 2 examples of how to do this but the answer you were looking for was the button answer so please enjoy and i wouldnt mind that rep like you promessed
|
|
| Back to top |
|
 |
MadDoom Cheater
Reputation: 0
Joined: 27 Dec 2006 Posts: 38
|
Posted: Fri Aug 24, 2007 3:25 am Post subject: |
|
|
| what language and what it is doing?
|
|
| Back to top |
|
 |
Pseudo Xero I post too much
Reputation: 0
Joined: 16 Feb 2007 Posts: 2607
|
Posted: Fri Aug 24, 2007 3:39 am Post subject: |
|
|
| MadDoom wrote: | | what language and what it is doing? |
VB, and I think it's for hotkeys.
|
|
| Back to top |
|
 |
assaf84 Expert Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 238
|
Posted: Fri Aug 24, 2007 3:54 am Post subject: |
|
|
| Looks like a hot key in VB
|
|
| Back to top |
|
 |
TheIndianGuy Advanced Cheater
Reputation: 102
Joined: 14 Jan 2007 Posts: 88
|
Posted: Sat Aug 25, 2007 10:12 pm Post subject: |
|
|
| yeah its using hotkeys in vb 2005
|
|
| Back to top |
|
 |
|