Hi,
When I call ShowDialog() method of the PrintPreviewDialog, in .Net 2.0, the
first time, all its toolbar buttons are present. Closing this window using
the Close buton on the toolbar and then recalling ShowDialog() on the
PrintPreviewDialog object, i can't see all my toolbars again!
Although closing the window using the Close button of the ControlBox in the
PrintPreviewDialog window works, with no problem, what is happening to the
close button on the toolbar?
My code work perfectly with the version 1.1 of the framework. Here is the
code to show this:
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Printing;
public class MyClass : Form {
PrintDocument doc;
PrintPreviewDialog preview;
Button button;
public MyClass () {
this.Text = "This is my print program";
button = new Button();
button.Text = "Click";
button.Location = new Point(20,20);
button.Click += new EventHandler(button_Click);
button.Parent = this;
doc = new PrintDocument();
doc.PrintPage += new PrintPageEventHandler(doc_PrintPage);
preview = new PrintPreviewDialog();
preview.Document = doc;
}
public static void Main () {
Application.Run(new MyClass());
}
void doc_PrintPage (object sender, PrintPageEventArgs e) {
Graphics grfx = e.Graphics;
grfx.Clear(Color.Blue);
//my drawing code goes here
}
public void button_Click (object sender, EventArgs e) {
preview.ShowDialog();
}
}
ADEBISI Foluso - 22 Jul 2005 12:51 GMT
Please I need your urgent help on this.
I'm currently developing an application that uses the PrintPreviewDialog
<b>heavily</b>.
Happy coding.
> Hi,
>
[quoted text clipped - 52 lines]
> }
> }