Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Windows
 ActiveX Controls
 Print Orientation Default
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jfgibson

10 Posts

Posted - 22 Feb 2005 :  18:23:00  Show Profile  Reply with Quote
I am using Visual Studio 6 with the CTWX.OCX charting control. Is there any way to configure PrinterSetup or related methods to command a default of landscape orientation? Perhaps as a method of the CPrintInfo object, using its pointer in OnPreparePrinting()?

I currently use the following series of calls in my Print Setup command handler:
m_GraphControl.SetPrintStyle(PRT_POSITIONONPAGE);
m_GraphControl.SetPrintTop(0.1);
m_GraphControl.SetPrintLeft(0.1);
m_GraphControl.SetPrintBottom(0.9);
m_GraphControl.SetPrintRight(0.9);
m_GraphControl.SetPrintBorder(FALSE);
m_GraphControl.PrinterSetup();

This works fine, but by default the printer properties dialog has portrait orientation selected, and users of my application will always prefer landscape orientation.


Jim Gibson

quinncurtis

1164 Posts

Posted - 23 Feb 2005 :  09:12:00  Show Profile  Reply with Quote
The control reads the Default printer settings of the selected printer and that is what the Printer Setup dialog is initialized with. The control does not have a property or method that will permit you to have the Printer Setup initialized with the default values, except for the orientation which in your case you want to force to Landscape printing, regardless of the default value.

From the Windows desktop, if you can get the user to change the default setting of the target printer to Landscape, the settings for that printer will come up in Landscape mode from the controls Printer Setup. If changing the default printer settings is not an option, you can have two versions of the same printer in the Printers folder, one setup for Portrait and one for Landscape. Of course in that case the Printer Setup dialog is still needed to change the selected printer to the one that uses Landscape as the default, and that is more trouble than just clicking the Landscape radio button.

I'm sure an internet search would come up with some way to change the default printer under program control, or to change the settings of the default printer under program control.

It is not necessary to call Printer Setup every time you print. Once it is called, it will remember that you have change the printer orientation and print in Landscape until changed back.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07