473,395 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

PrintPreviewControl

On initialization of my form, I am setting up PrintPreviewControl like this:
private void InitializePrintPreviewControl()
{
this._ppreview = new ICS.Client.Controls.PrintPreview();
//
// _ppreview
//
this._ppreview.AutoScroll = true;
this._ppreview.BackColor = System.Drawing.SystemColors.Window;
this._ppreview.Cursor = System.Windows.Forms.Cursors.Default;
this._ppreview.Dock = System.Windows.Forms.DockStyle.Fill;
this._ppreview.Location = new System.Drawing.Point(0, 0);
this._ppreview.Name = "_ppreview";
this._ppreview.Size = new System.Drawing.Size(592, 432);
this._ppreview.ImagePreview.Document = _docToPrint;
this._ppreview.TabIndex = 0;
this._docToPrint.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this .doc_PrintPage);
this._ppreview.UpdatePreview += new PrintSettingsModified(_ppreview_UpdatePreview);
this.ImageEditor_Fill_Panel.Controls.Add(this._ppr eview);
}


This code works perfectly fine just like it is.

But the problem is When a user presses the button to switch between
landscape and portrait, the UpdatePreview eventhandler is called, which
has code like this:

this._docToPrint.DefaultPageSettings.Landscape = true or false;

when this code is run, the control state does not change. i have tried
everything to update the printpreviewcontrol with the new landscape or
portrait setting, but nothing has worked.
I called invalidate(), removed the event handler for PrintPage, changed
the landscape property, and then reattached the event handler for
PrintPage, it still does not work.

I'll appreciate any help.

Basically what I am trying to do is, when by default, PrintPreview shows
the document in portrait, user can press the button to swtich between
Portrait and Landscape.

Thanks
Ali
Nov 16 '05 #1
0 2355

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Chad Chisholm | last post by:
I have the PrintPreviewControl on a form, a custom print options dialog. When the user changes a print option (like gridlines) I set the Document property of the PrintPreviewControl, thereby...
0
by: s-galit | last post by:
hi, i created form1 with a printPreviewControl and from form2 im creating an reference to the form1 , but the printPreviewControl is empty thats the code from form2- Dim printPrevCtrl1 As...
3
by: Ramsey Schaffnit | last post by:
Context: I have to print personal information on a preprinted form I've never seen using a printer I've never seen. I want to use a control to overlay the PrintPreview to indicate where I've...
0
by: sachin | last post by:
How to sence click event on the document when two pages are displayed in PrintPreviewControl. How to identify which page is clicked Moreover can we hookup Vertical scroll bar to Next/Previous Page,...
0
by: sachin | last post by:
How to display the vertical scroll bar of PrintPreviewControl programatically can we sense its up/down click events?
0
by: Yaron | last post by:
Hi, I have a PrintPreviewControl placed inside an inherited control (I am designing a wizard, and each wizard 'panel' is technically a control... The PrintPreviewControl is inside one of these...
0
by: Sachin | last post by:
Hello, I am trying to make a customized PrintPreviewDialog using PrintPreviewControl. Can any one please explain how to change the cursor only on the document that is displayed in the Preview...
0
by: Chad Chisholm | last post by:
I have the PrintPreviewControl on a dialog, and it's a great way to show the user what effect print settings have in somewhat real time. The only problem is when I set...
3
by: deciacco | last post by:
I'm trying to write a label printing SDI app with a small preview on the main form itself. Every time I run the InvalidatePreview event on the preview control to redraw the preview I get the...
3
by: IB | last post by:
... Can't get it to work. Whatever I do, I just get "document does not contain any pages". I am setting the document property to a valid document and if I just use the PrintPreviewDialog instead,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.