Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
785
How to position the Print Preview dialog?
posted

I can set the Width, Height, and Left location of the Print Preview dialog but I can not get the Top location to work.  In a simple application, I have a button handler that:

            UltraPrintPreviewDialog previewDialog = new UltraPrintPreviewDialog();
            UltraGridPrintDocument printDocument = new UltraGridPrintDocument();

            printDocument.Grid = ultraGrid1;
            previewDialog.Document = printDocument;

            // Set the location and size of the print preview dialog.
            previewDialog.Left = Left;
            previewDialog.Top = Top;    // sets the proper value but does not work
            previewDialog.Width = Width;
            previewDialog.Height = Height;
           
            previewDialog.ShowDialog(this);

When the dialog shows, it does not honor the Top position as set.  All other coordinates are honored. 

Some of the samples show how to position the dialog during an IntitializePrintPreview event but my grid's event handler never gets called for that event (I'm assuming it is because I call the dialog as shown above rather than setting the grid's properties and then invoking it via the grid).  Either way, I should be able to set the Top position and especially right before the Show() method is called.

My end goal is to place the preview dialog on top of my current form matching the exact width, height, and position.

Much thanks... 

 

Parents
No Data
Reply
  • 785
    Verified Answer
    posted

     I got around the issue where setting the Top value was not honored by simply hooking the Load event and setting all of the values there.  When set there, all values are honored.

Children