1 // Permission is hereby granted, free of charge, to any person obtaining
2 // a copy of this software and associated documentation files (the
3 // "Software"), to deal in the Software without restriction, including
4 // without limitation the rights to use, copy, modify, merge, publish,
5 // distribute, sublicense, and/or sell copies of the Software, and to
6 // permit persons to whom the Software is furnished to do so, subject to
7 // the following conditions:
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 // Copyright (c) 2006 Novell, Inc.
23 // Jonathan Chambers (jonathan.chambers@ansys.com)
27 using System.ComponentModel;
28 using System.ComponentModel.Design;
29 using System.ComponentModel.Design.Serialization;
30 using System.Collections;
31 using System.Diagnostics;
33 using System.Drawing.Printing;
34 using System.Globalization;
35 using System.Reflection;
37 namespace System.Windows.Forms {
39 [DefaultProperty("Document")]
40 public sealed class PageSetupDialog : CommonDialog {
41 //const int yard_pound_default = 100;
42 //static readonly int meter_default = (int) Math.Round (10 * 3.937 * 100);
44 #region Local variables
45 private PrintDocument document;
46 private PageSettings page_settings;
47 private PrinterSettings printer_settings;
48 private Margins min_margins;
49 private bool allow_margins;
50 private bool allow_orientation;
51 private bool allow_paper;
52 private bool allow_printer;
53 private bool show_help;
54 private bool show_network;
56 private GroupBox groupbox_paper;
57 private Label label_source;
58 private Label label_size;
59 private GroupBox groupbox_orientation;
60 private RadioButton radio_landscape;
61 private RadioButton radio_portrait;
62 private GroupBox groupbox_margin;
63 private Label label_left;
64 private Button button_help;
65 private Button button_ok;
66 private Button button_cancel;
67 private Button button_printer;
68 private Label label_top;
69 private Label label_right;
70 private Label label_bottom;
71 private NumericTextBox textbox_left;
72 private NumericTextBox textbox_top;
73 private NumericTextBox textbox_right;
74 private NumericTextBox textbox_bottom;
75 private ComboBox combobox_source;
76 private ComboBox combobox_size;
77 private PrinterForm printer_helper_form;
78 #endregion // Local variables
80 #region Public Constructors
81 public PageSetupDialog ()
83 InitializeComponent();
86 #endregion // Public Constructors
89 #region Public Instance Methods
90 public override void Reset ()
93 AllowOrientation = true;
98 MinMargins = new Margins (0, 0, 0, 0);
99 PrinterSettings = null;
103 #endregion // Public Instance Methods
105 #region Public Instance Properties
107 public bool AllowMargins {
108 get { return allow_margins; }
109 set { allow_margins = value; }
113 public bool AllowOrientation {
114 get { return allow_orientation; }
115 set { allow_orientation = value; }
119 public bool AllowPaper {
120 get { return allow_paper; }
121 set { allow_paper = value; }
125 public bool AllowPrinter {
126 get { return allow_printer; }
127 set { allow_printer = value; }
131 public PrintDocument Document {
132 get { return document; }
135 if (document != null) {
136 printer_settings = document.PrinterSettings;
137 page_settings = document.DefaultPageSettings;
142 public Margins MinMargins {
143 get { return min_margins; }
144 set { min_margins = value; }
149 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
150 public PageSettings PageSettings {
151 get { return page_settings; }
153 page_settings = value;
160 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
161 public PrinterSettings PrinterSettings {
162 get { return printer_settings; }
164 printer_settings = value;
169 [DefaultValue(false)]
170 public bool ShowHelp {
171 get { return show_help; }
173 if (value != show_help) {
181 public bool ShowNetwork {
182 get { return show_network; }
183 set { show_network = value; }
186 #endregion // Public Instance Properties
188 #region Protected Instance Methods
189 protected override bool RunDialog (IntPtr hwnd)
192 SetPrinterDetails ();
195 catch (Exception e) {
196 MessageBox.Show (e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
200 #endregion // Protected Instance Methods
202 #region Private Helper
203 private void InitializeComponent()
205 this.groupbox_paper = new System.Windows.Forms.GroupBox();
206 this.combobox_source = new System.Windows.Forms.ComboBox();
207 this.combobox_size = new System.Windows.Forms.ComboBox();
208 this.label_source = new System.Windows.Forms.Label();
209 this.label_size = new System.Windows.Forms.Label();
210 this.groupbox_orientation = new System.Windows.Forms.GroupBox();
211 this.radio_landscape = new System.Windows.Forms.RadioButton();
212 this.radio_portrait = new System.Windows.Forms.RadioButton();
213 this.groupbox_margin = new System.Windows.Forms.GroupBox();
214 this.label_left = new System.Windows.Forms.Label();
215 this.button_ok = new System.Windows.Forms.Button();
216 this.button_cancel = new System.Windows.Forms.Button();
217 this.button_printer = new System.Windows.Forms.Button();
218 this.label_top = new System.Windows.Forms.Label();
219 this.label_right = new System.Windows.Forms.Label();
220 this.label_bottom = new System.Windows.Forms.Label();
221 this.textbox_left = new System.Windows.Forms.NumericTextBox();
222 this.textbox_top = new System.Windows.Forms.NumericTextBox();
223 this.textbox_right = new System.Windows.Forms.NumericTextBox();
224 this.textbox_bottom = new System.Windows.Forms.NumericTextBox();
225 this.groupbox_paper.SuspendLayout();
226 this.groupbox_orientation.SuspendLayout();
227 this.groupbox_margin.SuspendLayout();
228 form.SuspendLayout();
232 this.groupbox_paper.Controls.Add(this.combobox_source);
233 this.groupbox_paper.Controls.Add(this.combobox_size);
234 this.groupbox_paper.Controls.Add(this.label_source);
235 this.groupbox_paper.Controls.Add(this.label_size);
236 this.groupbox_paper.Location = new System.Drawing.Point(12, 157);
237 this.groupbox_paper.Name = "groupbox_paper";
238 this.groupbox_paper.Size = new System.Drawing.Size(336, 90);
239 this.groupbox_paper.TabIndex = 0;
240 this.groupbox_paper.TabStop = false;
241 this.groupbox_paper.Text = "Paper";
245 this.combobox_source.Location = new System.Drawing.Point(84, 54);
246 this.combobox_source.Name = "combobox_source";
247 this.combobox_source.Size = new System.Drawing.Size(240, 21);
248 this.combobox_source.TabIndex = 3;
252 this.combobox_size.ItemHeight = 13;
253 this.combobox_size.Location = new System.Drawing.Point(84, 22);
254 this.combobox_size.Name = "combobox_size";
255 this.combobox_size.Size = new System.Drawing.Size(240, 21);
256 this.combobox_size.TabIndex = 2;
260 this.label_source.Location = new System.Drawing.Point(13, 58);
261 this.label_source.Name = "label_source";
262 this.label_source.Size = new System.Drawing.Size(48, 16);
263 this.label_source.TabIndex = 1;
264 this.label_source.Text = "&Source:";
268 this.label_size.Location = new System.Drawing.Point(13, 25);
269 this.label_size.Name = "label_size";
270 this.label_size.Size = new System.Drawing.Size(52, 16);
271 this.label_size.TabIndex = 0;
272 this.label_size.Text = "Si&ze:";
274 // groupbox_orientation
276 this.groupbox_orientation.Controls.Add(this.radio_landscape);
277 this.groupbox_orientation.Controls.Add(this.radio_portrait);
278 this.groupbox_orientation.Location = new System.Drawing.Point(12, 255);
279 this.groupbox_orientation.Name = "groupbox_orientation";
280 this.groupbox_orientation.Size = new System.Drawing.Size(96, 90);
281 this.groupbox_orientation.TabIndex = 1;
282 this.groupbox_orientation.TabStop = false;
283 this.groupbox_orientation.Text = "Orientation";
287 this.radio_landscape.Location = new System.Drawing.Point(13, 52);
288 this.radio_landscape.Name = "radio_landscape";
289 this.radio_landscape.Size = new System.Drawing.Size(80, 24);
290 this.radio_landscape.TabIndex = 7;
291 this.radio_landscape.Text = "L&andscape";
295 this.radio_portrait.Location = new System.Drawing.Point(13, 19);
296 this.radio_portrait.Name = "radio_portrait";
297 this.radio_portrait.Size = new System.Drawing.Size(72, 24);
298 this.radio_portrait.TabIndex = 6;
299 this.radio_portrait.Text = "P&ortrait";
303 this.groupbox_margin.Controls.Add(this.textbox_bottom);
304 this.groupbox_margin.Controls.Add(this.textbox_right);
305 this.groupbox_margin.Controls.Add(this.textbox_top);
306 this.groupbox_margin.Controls.Add(this.textbox_left);
307 this.groupbox_margin.Controls.Add(this.label_bottom);
308 this.groupbox_margin.Controls.Add(this.label_right);
309 this.groupbox_margin.Controls.Add(this.label_top);
310 this.groupbox_margin.Controls.Add(this.label_left);
311 this.groupbox_margin.Location = new System.Drawing.Point(120, 255);
312 this.groupbox_margin.Name = "groupbox_margin";
313 this.groupbox_margin.Size = new System.Drawing.Size(228, 90);
314 this.groupbox_margin.TabIndex = 2;
315 this.groupbox_margin.TabStop = false;
316 this.groupbox_margin.Text = LocalizedLengthUnit ();
320 this.label_left.Location = new System.Drawing.Point(11, 25);
321 this.label_left.Name = "label_left";
322 this.label_left.Size = new System.Drawing.Size(40, 23);
323 this.label_left.TabIndex = 0;
324 this.label_left.Text = "&Left:";
328 this.button_ok.Location = new System.Drawing.Point(120, 358);
329 this.button_ok.Name = "button_ok";
330 this.button_ok.Size = new System.Drawing.Size(72, 23);
331 this.button_ok.TabIndex = 3;
332 this.button_ok.Text = "OK";
333 this.button_ok.Click += new EventHandler (OnClickOkButton);
337 this.button_cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
338 this.button_cancel.Location = new System.Drawing.Point(198, 358);
339 this.button_cancel.Name = "button_cancel";
340 this.button_cancel.Size = new System.Drawing.Size(72, 23);
341 this.button_cancel.TabIndex = 4;
342 this.button_cancel.Text = "Cancel";
346 this.button_printer.Location = new System.Drawing.Point(276, 358);
347 this.button_printer.Name = "button_printer";
348 this.button_printer.Size = new System.Drawing.Size(72, 23);
349 this.button_printer.TabIndex = 5;
350 this.button_printer.Text = "&Printer...";
351 this.button_printer.Click += new EventHandler (OnClickPrinterButton);
355 this.label_top.Location = new System.Drawing.Point(11, 57);
356 this.label_top.Name = "label_top";
357 this.label_top.Size = new System.Drawing.Size(40, 23);
358 this.label_top.TabIndex = 1;
359 this.label_top.Text = "&Top:";
363 this.label_right.Location = new System.Drawing.Point(124, 25);
364 this.label_right.Name = "label_right";
365 this.label_right.Size = new System.Drawing.Size(40, 23);
366 this.label_right.TabIndex = 2;
367 this.label_right.Text = "&Right:";
371 this.label_bottom.Location = new System.Drawing.Point(124, 57);
372 this.label_bottom.Name = "label_bottom";
373 this.label_bottom.Size = new System.Drawing.Size(40, 23);
374 this.label_bottom.TabIndex = 3;
375 this.label_bottom.Text = "&Bottom:";
379 this.textbox_left.Location = new System.Drawing.Point(57, 21);
380 this.textbox_left.Name = "textbox_left";
381 this.textbox_left.Size = new System.Drawing.Size(48, 20);
382 this.textbox_left.TabIndex = 4;
386 this.textbox_top.Location = new System.Drawing.Point(57, 54);
387 this.textbox_top.Name = "textbox_top";
388 this.textbox_top.Size = new System.Drawing.Size(48, 20);
389 this.textbox_top.TabIndex = 5;
393 this.textbox_right.Location = new System.Drawing.Point(171, 21);
394 this.textbox_right.Name = "textbox_right";
395 this.textbox_right.Size = new System.Drawing.Size(48, 20);
396 this.textbox_right.TabIndex = 6;
400 this.textbox_bottom.Location = new System.Drawing.Point(171, 54);
401 this.textbox_bottom.Name = "textbox_bottom";
402 this.textbox_bottom.Size = new System.Drawing.Size(48, 20);
403 this.textbox_bottom.TabIndex = 7;
407 form.AcceptButton = this.button_ok;
408 form.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
409 form.CancelButton = this.button_cancel;
410 form.ClientSize = new System.Drawing.Size(360, 390);
411 form.Controls.Add(this.button_printer);
412 form.Controls.Add(this.button_cancel);
413 form.Controls.Add(this.button_ok);
414 form.Controls.Add(this.groupbox_margin);
415 form.Controls.Add(this.groupbox_orientation);
416 form.Controls.Add(this.groupbox_paper);
417 form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
418 form.HelpButton = true;
419 form.MaximizeBox = false;
420 form.MinimizeBox = false;
422 form.ShowInTaskbar = false;
423 form.Text = "Page Setup";
424 this.groupbox_paper.ResumeLayout(false);
425 this.groupbox_orientation.ResumeLayout(false);
426 this.groupbox_margin.ResumeLayout(false);
427 form.ResumeLayout(false);
431 static bool UseYardPound {
432 get { return !RegionInfo.CurrentRegion.IsMetric; } }
434 // .Net uses PrinterSettings property if it is not null.
435 // Otherwise, it uses PageSettings.PrinterSettings to set values.
436 // We use this property internally to automatically select the available one.
437 PrinterSettings InternalPrinterSettings {
439 return (printer_settings == null ? page_settings.PrinterSettings :
444 private double ToLocalizedLength (int marginsUnit)
446 return UseYardPound ?
447 marginsUnit / 100.0 :
451 private int FromLocalizedLength (double marginsUnit)
453 return UseYardPound ?
454 (int) (marginsUnit * 100.0) :
455 (int) (marginsUnit * 3.937);
458 private string LocalizedLengthUnit ()
460 return UseYardPound ? "Margins (inches)" : "Margins (millimeters)";
463 private void SetPrinterDetails ()
465 if (PageSettings == null)
466 throw new ArgumentException ("PageSettings");
468 combobox_size.Items.Clear ();
469 foreach (PaperSize paper_size in InternalPrinterSettings.PaperSizes)
470 combobox_size.Items.Add (paper_size.PaperName);
471 combobox_size.SelectedItem = page_settings.PaperSize.PaperName;
473 combobox_source.Items.Clear ();
474 foreach (PaperSource paper_source in InternalPrinterSettings.PaperSources)
475 combobox_source.Items.Add (paper_source.SourceName);
476 combobox_source.SelectedItem = page_settings.PaperSource.SourceName;
478 if (PageSettings.Landscape)
479 radio_landscape.Checked = true;
481 radio_portrait.Checked = true;
486 Margins page_margins = PageSettings.Margins;
487 Margins min_margins = MinMargins;
489 // Update margin data
490 textbox_top.Text = ToLocalizedLength (page_margins.Top).ToString ();
491 textbox_bottom.Text = ToLocalizedLength (page_margins.Bottom).ToString ();
492 textbox_left.Text = ToLocalizedLength (page_margins.Left).ToString ();
493 textbox_right.Text = ToLocalizedLength (page_margins.Right).ToString ();
494 textbox_top.Min = ToLocalizedLength (min_margins.Top);
495 textbox_bottom.Min = ToLocalizedLength (min_margins.Bottom);
496 textbox_left.Min = ToLocalizedLength (min_margins.Left);
497 textbox_right.Min = ToLocalizedLength (min_margins.Right);
499 button_printer.Enabled = AllowPrinter && PrinterSettings != null;
500 groupbox_orientation.Enabled = AllowOrientation;
501 groupbox_paper.Enabled = AllowPaper;
502 groupbox_margin.Enabled = AllowMargins;
505 private void OnClickOkButton (object sender, EventArgs e)
507 if (combobox_size.SelectedItem != null) {
508 foreach (PaperSize paper_size in InternalPrinterSettings.PaperSizes) {
509 if (paper_size.PaperName == (string) combobox_size.SelectedItem) {
510 PageSettings.PaperSize = paper_size;
516 if (combobox_source.SelectedItem != null) {
517 foreach (PaperSource paper_source in InternalPrinterSettings.PaperSources) {
518 if (paper_source.SourceName == (string) combobox_source.SelectedItem) {
519 PageSettings.PaperSource = paper_source;
525 Margins margins = new Margins ();
526 margins.Top = FromLocalizedLength (textbox_top.Value);
527 margins.Bottom = FromLocalizedLength (textbox_bottom.Value);
528 margins.Left = FromLocalizedLength (textbox_left.Value);
529 margins.Right = FromLocalizedLength (textbox_right.Value);
530 PageSettings.Margins = margins;
532 PageSettings.Landscape = radio_landscape.Checked;
533 form.DialogResult = DialogResult.OK;
536 void ShowHelpButton ()
538 if (button_help == null) {
539 button_help = new Button ();
540 button_help.Location = new System.Drawing.Point (12, 358);
541 button_help.Name = "button_help";
542 button_help.Size = new System.Drawing.Size (72, 23);
543 button_help.Text = "&Help";
544 form.Controls.Add (button_help);
547 button_help.Visible = show_help;
550 void OnClickPrinterButton (object sender, EventArgs args)
552 if (printer_helper_form == null)
553 printer_helper_form = new PrinterForm (this);
555 printer_helper_form.UpdateValues ();
557 // Here update values for PrinterSettings
558 if (printer_helper_form.ShowDialog () == DialogResult.OK)
559 if (printer_helper_form.SelectedPrinter != PrinterSettings.PrinterName)
560 PrinterSettings.PrinterName = printer_helper_form.SelectedPrinter;
564 #endregion // Private Helper
566 class PrinterForm : Form
568 private System.Windows.Forms.GroupBox groupbox_printer;
569 private System.Windows.Forms.ComboBox combobox_printers;
570 private System.Windows.Forms.Label label_name;
571 private System.Windows.Forms.Label label_status;
572 private System.Windows.Forms.Button button_properties;
573 private System.Windows.Forms.Button button_network;
574 private System.Windows.Forms.Button button_cancel;
575 private System.Windows.Forms.Button button_ok;
576 private System.Windows.Forms.Label label_status_text;
577 private System.Windows.Forms.Label label_type;
578 private System.Windows.Forms.Label label_where;
579 private System.Windows.Forms.Label label_where_text;
580 private System.Windows.Forms.Label label_type_text;
581 private System.Windows.Forms.Label label_comment;
582 private System.Windows.Forms.Label label_comment_text;
583 PageSetupDialog page_setup_dialog;
585 public PrinterForm (PageSetupDialog page_setup_dialog)
587 InitializeComponent();
588 this.page_setup_dialog = page_setup_dialog;
591 public string SelectedPrinter {
593 return (string) combobox_printers.SelectedItem;
596 combobox_printers.SelectedItem = value;
597 label_type_text.Text = value;
601 public void UpdateValues ()
603 combobox_printers.Items.Clear ();
604 foreach (string printer_name in PrinterSettings.InstalledPrinters)
605 combobox_printers.Items.Add (printer_name);
607 // Select the printer indicated by PageSetupDialog.PrinterSettings
608 SelectedPrinter = page_setup_dialog.PrinterSettings.PrinterName;
610 button_network.Enabled = page_setup_dialog.ShowNetwork;
613 #region Windows Form Designer generated code
614 private void InitializeComponent()
616 this.groupbox_printer = new System.Windows.Forms.GroupBox();
617 this.combobox_printers = new System.Windows.Forms.ComboBox();
618 this.button_network = new System.Windows.Forms.Button();
619 this.button_cancel = new System.Windows.Forms.Button();
620 this.button_ok = new System.Windows.Forms.Button();
621 this.label_name = new System.Windows.Forms.Label();
622 this.label_status = new System.Windows.Forms.Label();
623 this.label_status_text = new System.Windows.Forms.Label();
624 this.label_type = new System.Windows.Forms.Label();
625 this.label_type_text = new System.Windows.Forms.Label();
626 this.label_where = new System.Windows.Forms.Label();
627 this.label_comment = new System.Windows.Forms.Label();
628 this.label_where_text = new System.Windows.Forms.Label();
629 this.label_comment_text = new System.Windows.Forms.Label();
630 this.button_properties = new System.Windows.Forms.Button();
631 this.groupbox_printer.SuspendLayout();
632 this.SuspendLayout();
636 this.groupbox_printer.Controls.AddRange(new System.Windows.Forms.Control[] {
637 this.button_properties,
638 this.label_comment_text,
639 this.label_where_text,
642 this.label_type_text,
644 this.label_status_text,
647 this.combobox_printers});
648 this.groupbox_printer.Location = new System.Drawing.Point(12, 8);
649 this.groupbox_printer.Name = "groupbox_printer";
650 this.groupbox_printer.Size = new System.Drawing.Size(438, 136);
651 this.groupbox_printer.Text = "Printer";
655 this.combobox_printers.Location = new System.Drawing.Point(64, 24);
656 this.combobox_printers.Name = "combobox_printers";
657 this.combobox_printers.SelectedValueChanged += new EventHandler (OnSelectedValueChangedPrinters);
658 this.combobox_printers.Size = new System.Drawing.Size(232, 21);
659 this.combobox_printers.TabIndex = 1;
663 this.button_network.Location = new System.Drawing.Point(16, 160);
664 this.button_network.Name = "button_network";
665 this.button_network.Size = new System.Drawing.Size(68, 22);
666 this.button_network.TabIndex = 5;
667 this.button_network.Text = "Network...";
671 this.button_cancel.DialogResult = DialogResult.Cancel;
672 this.button_cancel.Location = new System.Drawing.Point(376, 160);
673 this.button_cancel.Name = "button_cancel";
674 this.button_cancel.Size = new System.Drawing.Size(68, 22);
675 this.button_cancel.TabIndex = 4;
676 this.button_cancel.Text = "Cancel";
680 this.button_ok.DialogResult = DialogResult.OK;
681 this.button_ok.Location = new System.Drawing.Point(300, 160);
682 this.button_ok.Name = "button_ok";
683 this.button_ok.Size = new System.Drawing.Size(68, 22);
684 this.button_ok.TabIndex = 3;
685 this.button_ok.Text = "OK";
689 this.label_name.Location = new System.Drawing.Point(12, 28);
690 this.label_name.Name = "label_name";
691 this.label_name.Size = new System.Drawing.Size(48, 20);
692 this.label_name.Text = "Name:";
696 this.label_status.Location = new System.Drawing.Point(6, 52);
697 this.label_status.Name = "label_status";
698 this.label_status.Size = new System.Drawing.Size(58, 14);
699 this.label_status.Text = "Status:";
703 this.label_status_text.Location = new System.Drawing.Point(64, 52);
704 this.label_status_text.Name = "label_status_text";
705 this.label_status_text.Size = new System.Drawing.Size(64, 14);
706 this.label_status_text.Text = String.Empty;
710 this.label_type.Location = new System.Drawing.Point(6, 72);
711 this.label_type.Name = "label_type";
712 this.label_type.Size = new System.Drawing.Size(58, 14);
713 this.label_type.Text = "Type:";
717 this.label_type_text.Location = new System.Drawing.Point(64, 72);
718 this.label_type_text.Name = "label_type_text";
719 this.label_type_text.Size = new System.Drawing.Size(232, 14);
720 this.label_type_text.TabIndex = 5;
721 this.label_type_text.Text = String.Empty;
725 this.label_where.Location = new System.Drawing.Point(6, 92);
726 this.label_where.Name = "label_where";
727 this.label_where.Size = new System.Drawing.Size(58, 16);
728 this.label_where.TabIndex = 6;
729 this.label_where.Text = "Where:";
733 this.label_comment.Location = new System.Drawing.Point(6, 112);
734 this.label_comment.Name = "label_comment";
735 this.label_comment.Size = new System.Drawing.Size(56, 16);
736 this.label_comment.Text = "Comment:";
740 this.label_where_text.Location = new System.Drawing.Point(64, 92);
741 this.label_where_text.Name = "label_where_text";
742 this.label_where_text.Size = new System.Drawing.Size(232, 16);
743 this.label_where_text.Text = String.Empty;
745 // label_comment_text
747 this.label_comment_text.Location = new System.Drawing.Point(64, 112);
748 this.label_comment_text.Name = "label_comment_text";
749 this.label_comment_text.Size = new System.Drawing.Size(232, 16);
750 this.label_comment_text.Text = String.Empty;
754 this.button_properties.Location = new System.Drawing.Point(308, 22);
755 this.button_properties.Name = "button_properties";
756 this.button_properties.Size = new System.Drawing.Size(92, 22);
757 this.button_properties.TabIndex = 2;
758 this.button_properties.Text = "Properties...";
762 this.AllowDrop = true;
763 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
764 this.AcceptButton = button_ok;
765 this.CancelButton = button_cancel;
766 this.ClientSize = new System.Drawing.Size(456, 194);
767 this.Controls.AddRange(new System.Windows.Forms.Control[] {
771 this.groupbox_printer});
772 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
773 this.HelpButton = true;
774 this.MaximizeBox = false;
775 this.MinimizeBox = false;
776 this.Name = "PrinterForm";
777 this.ShowInTaskbar = false;
778 this.Text = "Configure page";
779 this.groupbox_printer.ResumeLayout(false);
780 this.ResumeLayout(false);
783 void OnSelectedValueChangedPrinters (object sender, EventArgs args)
785 SelectedPrinter = (string) combobox_printers.SelectedItem;