/// <summary> /// Show Dialog to allow user to adjust printer/settings /// </summary> /// <param name="hwnd">Window owner</param> /// <returns>True is user was ready to print</returns> public bool ShowDialog(IntPtr hwnd) { NativePrintDialog dlg = new NativePrintDialog() { PrintTicket = mPrintTicket, PrintQueue = mPrintQueue, MinPage = MinPage, MaxPage = MaxPage, PageRangeEnabled = UserPageRangeEnabled, PageRange = new PageRange(Math.Max(1, mPageRange.PageFrom), mPageRange.PageTo), PageRangeSelection = mPageRangeSelection }; uint result = dlg.ShowDialog(hwnd); if (result == 1 || result == 2) { mPrintQueue = dlg.PrintQueue; mPrintTicket = dlg.PrintTicket; mPageRange = dlg.PageRange; mPageRangeSelection = dlg.PageRangeSelection; } return (result == 1); }