Hi there,
Does anyone know the VB 6 code for printing landscape.
Have tried: but doesnt seem to work.
cmdPrint.DefaultPageSettings.Landscape = True
Printable View
Hi there,
Does anyone know the VB 6 code for printing landscape.
Have tried: but doesnt seem to work.
cmdPrint.DefaultPageSettings.Landscape = True
Is cmdPrint as command button? If so, there is no sub property as DeffaultPageSettings with a command button.
In VB6, user the Printer Object, and you can set its Orientation method to landscape. Example:Code:Printer.FontName = "arial"
Printer.FontUnderline = True
Printer.FontSize = 8
Printer.Orientation = vbPRORLandscape
'etc
Hi there Hack,Quote:
Originally Posted by Hack
Yes it is a Command Button. I have Print in the Mnu, but i wanted the Quick Print Command button to print what i can see.
See attached the .exe for my project.
Jon
There is absolutely no way that I, or anyone else, is going to down load a zip file with nothing but an .Exe file in it.
First off, I can't tell anything without looking at the source code, but far more importantly, I have no idea what that .exe does, and no intention of finding out.
Attach your source code or post it.
Ok...fair enough...viruses and all that.
See attached the form file
I have seen this form before. :)
Now, your original question was just how do you print landscape.
What is it that you want to print. The Form itself? (very easy)
Yes the form....The Print in the Menu bit at the top is coded to do a VB Customised Print.
What i want is that it shows the whole screen (as if it was a print screen on the program)
Can you help??
Anybody???
Exe attachment removed in post #3.
To answer the first question: Tell the Printer object to print landscape.
Printer.Orientation = vbPRORLandscape
If you want to print a screenshot then you could use the keybd_event API to invoke the PrintScreen button and copy the screenshot to the clipboard. Then paste it into a hidden picturebox. Finally print the picturebox.
Ok, how can i code that?? It looks pretty straight forward, but i am not that experienced.
Here is the API definition. You can get it and allot of others if you download the api viewer utility (link in my signature).
There are several code examples already on the forums if you need more. :)
vb Code:
Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long) 'And Const Private Const VK_SNAPSHOT As Long = &H2C