473,320 Members | 1,817 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,320 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 2346

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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.