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...
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.
When I was playing around with these features in the past, I used:
ultraPrintPreviewDialog1.Show(); ultraPrintPreviewDialog1.FindForm().WindowState = FormWindowState.Maximized; ultraPrintPreviewDialog1.FindForm().TopMost = true;