Hi All,
vb.net , WinForm
I would like to fire ALT+P hot keys with the timer or a button..
any helps?
best regards
Krasimir
Printable View
Hi All,
vb.net , WinForm
I would like to fire ALT+P hot keys with the timer or a button..
any helps?
best regards
Krasimir
Yes, assign the hotkey to the menuitem for printing.
eg. you have a main menu that contains a file menu with a submenu named print, assign the hotkey Alt P to the print submenu.
Revised: AltP is not an assignable shortcut, I don't know why but I'll see what I can find.
Thank you CyberHawke,
seems to be a dificult task with the timer event.
the timer will be activated on period of time and Alt+P should be activated somehow from Timer1_Tick Event..
best regards
Karsimir
you should just call your print routine directly from the Timer_Tick event.
the problem is that i do not need Alt+P for printing routine,
i would like to use also Alt+L for other wake up session
somehow should find code to activate keyboard with vb.net
best regards
Krasimir
this?
please inform me if i'm on the wrong thread. i'll delete this. thanx.VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Text = "The quick brown monkey jumps over the lazy dog." End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load KeyPreview = True End Sub Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown If e.Alt And e.KeyCode = Keys.P Then Button1.PerfumeClick() 'Button1.PerformClick() End If End Sub
Dear Kasimir, I'm not sure if this could be a useful suggestion (My english is really weak). If you need to fire a routine in your Tick event, you can set a flag in your button click event and you can run the appropriate routine testing flag in timer Tick event procedure. I've not understood why you can't use Alt+L as a direct shortcut, anyway if you want to use particular combinations (Ctrl+Shift+SpaceBar for example) to perform your shortcut, you can use the Brown Monkey's way, or you can directly set the Flag in place of Button1.PerformClick. Another suggestion....e.handled=true could be a useful idea.
Good job.
:)