VB.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 300,419 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,507 people online right now. Registration is fast and FREE... Join Now!




how can print a document using keyboard shortcut in vb.net

 

how can print a document using keyboard shortcut in vb.net

maheen123

29 Jun, 2009 - 07:09 AM
Post #1

New D.I.C Head
*

Joined: 29 Jun, 2009
Posts: 2

Hi!

i have built a form application in vb.net... now i want to use keyboard shortcut CTRl+P for printing a report from the form... how can i do this.. what event shoud i need to do and how.. please help me.. its urgernt

User is offlineProfile CardPM
+Quote Post


NoBrain

RE: How Can Print A Document Using Keyboard Shortcut In Vb.net

29 Jun, 2009 - 11:51 AM
Post #2

D.I.C Lover
Group Icon

Joined: 25 Mar, 2009
Posts: 1,152



Thanked: 33 times
Dream Kudos: 125
My Contributions
in menu editor there is a shortcut option

other way to do it
CODE

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
        Case vbKeyF2
            something
    End Select
End Sub





but................................ no more help if you dont send code sad.gif
User is offlineProfile CardPM
+Quote Post

firebolt

RE: How Can Print A Document Using Keyboard Shortcut In Vb.net

30 Jun, 2009 - 12:28 AM
Post #3

D.I.C Lover
Group Icon

Joined: 20 Feb, 2009
Posts: 5,463



Thanked: 75 times
Dream Kudos: 1675
My Contributions
Are you saying that your code is VB.NET? If so, this is the wrong forum.
User is offlineProfile CardPM
+Quote Post

NoBrain

RE: How Can Print A Document Using Keyboard Shortcut In Vb.net

30 Jun, 2009 - 02:16 AM
Post #4

D.I.C Lover
Group Icon

Joined: 25 Mar, 2009
Posts: 1,152



Thanked: 33 times
Dream Kudos: 125
My Contributions
oh demn biggrin.gif that is true
User is offlineProfile CardPM
+Quote Post

BetaWar

RE: How Can Print A Document Using Keyboard Shortcut In Vb.net

30 Jun, 2009 - 06:51 AM
Post #5

#include <soul.h>
Group Icon

Joined: 7 Sep, 2006
Posts: 4,729



Thanked: 269 times
Dream Kudos: 1400
My Contributions
Moved to VB.net
User is offlineProfile CardPM
+Quote Post

firebolt

RE: How Can Print A Document Using Keyboard Shortcut In Vb.net

30 Jun, 2009 - 10:03 PM
Post #6

D.I.C Lover
Group Icon

Joined: 20 Feb, 2009
Posts: 5,463



Thanked: 75 times
Dream Kudos: 1675
My Contributions
Thanks Beta.

You may need to look for ASCII codes and determine when this type of key is pressed, then something will happen. Assuming that you actually have something close to what you want, look here for ASCII codes so when they are triggered, your function will be enabled.
http://www.scotek.demon.co.uk/ascii.html

User is offlineProfile CardPM
+Quote Post

juunas

RE: How Can Print A Document Using Keyboard Shortcut In Vb.net

1 Jul, 2009 - 08:10 AM
Post #7

D.I.C Head
**

Joined: 25 Mar, 2009
Posts: 57



Thanked: 3 times
My Contributions
The other method is to have a menustrip in the application, and make a print option in the menu. You can then just set shortcut to it. Then just make the printing code in the menuitem's Click event.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 11:49PM

Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month