Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Drawing / July 2005

Tip: Looking for answers? Try searching our database.

PrintPreviewDialog 2.0 has some slight error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ADEBISI Foluso - 19 Jul 2005 02:32 GMT
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]
>        }
> }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.