public Form() { _fixer = new Internal.FormHelper(this); _fixer.EnableBoundsTracking = true; _lastSizeGripStyle = SizeGripStyle; }
public Form() { _fixer = new FormHelper(this) { EnableBoundsTracking = true }; _lastSizeGripStyle = SizeGripStyle; }
public Form () { SizeF current_scale = GetAutoScaleSize (Font); autoscale = true; autoscale_base_size = new Size ((int)Math.Round (current_scale.Width), (int)Math.Round(current_scale.Height)); allow_transparency = false; closing = false; is_modal = false; dialog_result = DialogResult.None; start_position = FormStartPosition.WindowsDefaultLocation; form_border_style = FormBorderStyle.Sizable; window_state = FormWindowState.Normal; key_preview = false; opacity = 1D; menu = null; icon = default_icon; minimum_size = Size.Empty; maximum_size = Size.Empty; clientsize_set = Size.Empty; control_box = true; minimize_box = true; maximize_box = true; help_button = false; show_in_taskbar = true; is_visible = false; is_toplevel = true; size_grip_style = SizeGripStyle.Auto; maximized_bounds = Rectangle.Empty; default_maximized_bounds = Rectangle.Empty; owned_forms = new Form.ControlCollection(this); transparency_key = Color.Empty; CreateDockPadding (); InternalClientSize = new Size (this.Width - (SystemInformation.FrameBorderSize.Width * 2), this.Height - (SystemInformation.FrameBorderSize.Height * 2) - SystemInformation.CaptionHeight); restore_bounds = Bounds; }
void InitForm() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PrintPreviewDialog)); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.printToolStripButton = new System.Windows.Forms.ToolStripButton(); this.zoomToolStripSplitButton = new System.Windows.Forms.ToolStripSplitButton(); this.autoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripMenuItem(); this.separatorToolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); this.onepageToolStripButton = new System.Windows.Forms.ToolStripButton(); this.twopagesToolStripButton = new System.Windows.Forms.ToolStripButton(); this.threepagesToolStripButton = new System.Windows.Forms.ToolStripButton(); this.fourpagesToolStripButton = new System.Windows.Forms.ToolStripButton(); this.sixpagesToolStripButton = new System.Windows.Forms.ToolStripButton(); this.separatorToolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.closeToolStripButton = new System.Windows.Forms.ToolStripButton(); this.pageCounter = new System.Windows.Forms.NumericUpDown(); this.pageToolStripLabel = new System.Windows.Forms.ToolStripLabel(); this.toolStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pageCounter)).BeginInit(); this.SuspendLayout(); // // toolStrip1 // resources.ApplyResources(this.toolStrip1, "toolStrip1"); this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.printToolStripButton, this.zoomToolStripSplitButton, this.separatorToolStripSeparator, this.onepageToolStripButton, this.twopagesToolStripButton, this.threepagesToolStripButton, this.fourpagesToolStripButton, this.sixpagesToolStripButton, this.separatorToolStripSeparator1, this.closeToolStripButton}); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; this.toolStrip1.GripStyle = ToolStripGripStyle.Hidden; // // printToolStripButton // this.printToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.printToolStripButton.Name = "printToolStripButton"; resources.ApplyResources(this.printToolStripButton, "printToolStripButton"); // // zoomToolStripSplitButton // this.zoomToolStripSplitButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.zoomToolStripSplitButton.DoubleClickEnabled = true; this.zoomToolStripSplitButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.autoToolStripMenuItem, this.toolStripMenuItem1, this.toolStripMenuItem2, this.toolStripMenuItem3, this.toolStripMenuItem4, this.toolStripMenuItem5, this.toolStripMenuItem6, this.toolStripMenuItem7, this.toolStripMenuItem8}); this.zoomToolStripSplitButton.Name = "zoomToolStripSplitButton"; this.zoomToolStripSplitButton.SplitterWidth = 1; resources.ApplyResources(this.zoomToolStripSplitButton, "zoomToolStripSplitButton"); // // autoToolStripMenuItem // this.autoToolStripMenuItem.CheckOnClick = true; this.autoToolStripMenuItem.DoubleClickEnabled = true; this.autoToolStripMenuItem.Checked = true; this.autoToolStripMenuItem.Name = "autoToolStripMenuItem"; resources.ApplyResources(this.autoToolStripMenuItem, "autoToolStripMenuItem"); // // toolStripMenuItem1 // this.toolStripMenuItem1.CheckOnClick = true; this.toolStripMenuItem1.DoubleClickEnabled = true; this.toolStripMenuItem1.Name = "toolStripMenuItem1"; resources.ApplyResources(this.toolStripMenuItem1, "toolStripMenuItem1"); // // toolStripMenuItem2 // this.toolStripMenuItem2.CheckOnClick = true; this.toolStripMenuItem2.DoubleClickEnabled = true; this.toolStripMenuItem2.Name = "toolStripMenuItem2"; resources.ApplyResources(this.toolStripMenuItem2, "toolStripMenuItem2"); // // toolStripMenuItem3 // this.toolStripMenuItem3.CheckOnClick = true; this.toolStripMenuItem3.DoubleClickEnabled = true; this.toolStripMenuItem3.Name = "toolStripMenuItem3"; resources.ApplyResources(this.toolStripMenuItem3, "toolStripMenuItem3"); // // toolStripMenuItem4 // this.toolStripMenuItem4.CheckOnClick = true; this.toolStripMenuItem4.DoubleClickEnabled = true; this.toolStripMenuItem4.Name = "toolStripMenuItem4"; resources.ApplyResources(this.toolStripMenuItem4, "toolStripMenuItem4"); // // toolStripMenuItem5 // this.toolStripMenuItem5.CheckOnClick = true; this.toolStripMenuItem5.DoubleClickEnabled = true; this.toolStripMenuItem5.Name = "toolStripMenuItem5"; resources.ApplyResources(this.toolStripMenuItem5, "toolStripMenuItem5"); // // toolStripMenuItem6 // this.toolStripMenuItem6.CheckOnClick = true; this.toolStripMenuItem6.DoubleClickEnabled = true; this.toolStripMenuItem6.Name = "toolStripMenuItem6"; resources.ApplyResources(this.toolStripMenuItem6, "toolStripMenuItem6"); // // toolStripMenuItem7 // this.toolStripMenuItem7.CheckOnClick = true; this.toolStripMenuItem7.DoubleClickEnabled = true; this.toolStripMenuItem7.Name = "toolStripMenuItem7"; resources.ApplyResources(this.toolStripMenuItem7, "toolStripMenuItem7"); // // toolStripMenuItem8 // this.toolStripMenuItem8.CheckOnClick = true; this.toolStripMenuItem8.DoubleClickEnabled = true; this.toolStripMenuItem8.Name = "toolStripMenuItem8"; resources.ApplyResources(this.toolStripMenuItem8, "toolStripMenuItem8"); // // separatorToolStripSeparator // this.separatorToolStripSeparator.Name = "separatorToolStripSeparator"; // // onepageToolStripButton // this.onepageToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.onepageToolStripButton.Name = "onepageToolStripButton"; resources.ApplyResources(this.onepageToolStripButton, "onepageToolStripButton"); // // twopagesToolStripButton // this.twopagesToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.twopagesToolStripButton.Name = "twopagesToolStripButton"; resources.ApplyResources(this.twopagesToolStripButton, "twopagesToolStripButton"); // // threepagesToolStripButton // this.threepagesToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.threepagesToolStripButton.Name = "threepagesToolStripButton"; resources.ApplyResources(this.threepagesToolStripButton, "threepagesToolStripButton"); // // fourpagesToolStripButton // this.fourpagesToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.fourpagesToolStripButton.Name = "fourpagesToolStripButton"; resources.ApplyResources(this.fourpagesToolStripButton, "fourpagesToolStripButton"); // // sixpagesToolStripButton // this.sixpagesToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.sixpagesToolStripButton.Name = "sixpagesToolStripButton"; resources.ApplyResources(this.sixpagesToolStripButton, "sixpagesToolStripButton"); // // separatorToolStripSeparator1 // this.separatorToolStripSeparator1.Name = "separatorToolStripSeparator1"; // // closeToolStripButton // this.closeToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Text; this.closeToolStripButton.Name = "closeToolStripButton"; resources.ApplyResources(this.closeToolStripButton, "closeToolStripButton"); // // pageCounter // resources.ApplyResources(this.pageCounter, "pageCounter"); pageCounter.Text = "1"; pageCounter.TextAlign = HorizontalAlignment.Right; pageCounter.DecimalPlaces = 0; pageCounter.Minimum = new Decimal(0d); pageCounter.Maximum = new Decimal(1000d); pageCounter.ValueChanged += new EventHandler(UpdownMove); this.pageCounter.Name = "pageCounter"; // // pageToolStripLabel // this.pageToolStripLabel.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; this.pageToolStripLabel.Name = "pageToolStripLabel"; resources.ApplyResources(this.pageToolStripLabel, "pageToolStripLabel"); previewControl.Size = new Size(792, 610); previewControl.Location = new Point(0, 43); previewControl.Dock = DockStyle.Fill; previewControl.StartPageChanged += new EventHandler(previewControl_StartPageChanged); //EVENTS and Images ... this.printToolStripButton.Click += new System.EventHandler(this.OnprintToolStripButtonClick); this.autoToolStripMenuItem.Click += new System.EventHandler(ZoomAuto); this.toolStripMenuItem1.Click += new System.EventHandler(Zoom500); this.toolStripMenuItem2.Click += new System.EventHandler(Zoom250); this.toolStripMenuItem3.Click += new System.EventHandler(Zoom150); this.toolStripMenuItem4.Click += new System.EventHandler(Zoom100); this.toolStripMenuItem5.Click += new System.EventHandler(Zoom75); this.toolStripMenuItem6.Click += new System.EventHandler(Zoom50); this.toolStripMenuItem7.Click += new System.EventHandler(Zoom25); this.toolStripMenuItem8.Click += new System.EventHandler(Zoom10); this.onepageToolStripButton.Click += new System.EventHandler(this.OnonepageToolStripButtonClick); this.twopagesToolStripButton.Click += new System.EventHandler(this.OntwopagesToolStripButtonClick); this.threepagesToolStripButton.Click += new System.EventHandler(this.OnthreepagesToolStripButtonClick); this.fourpagesToolStripButton.Click += new System.EventHandler(this.OnfourpagesToolStripButtonClick); this.sixpagesToolStripButton.Click += new System.EventHandler(this.OnsixpagesToolStripButtonClick); this.closeToolStripButton.Click += new System.EventHandler(this.OncloseToolStripButtonClick); this.closeToolStripButton.Paint += new PaintEventHandler(this.OncloseToolStripButtonPaint); //Images this.toolStrip1.ImageList = imageList; this.printToolStripButton.ImageIndex = 0; this.zoomToolStripSplitButton.ImageIndex = 1; this.onepageToolStripButton.ImageIndex = 2; this.twopagesToolStripButton.ImageIndex = 3; this.threepagesToolStripButton.ImageIndex = 4; this.fourpagesToolStripButton.ImageIndex = 5; this.sixpagesToolStripButton.ImageIndex = 6; //tabIndex previewControl.TabIndex = 0; toolStrip1.TabIndex = 1; //DefaultItem on the Zoom SplitButton zoomToolStripSplitButton.DefaultItem = autoToolStripMenuItem; //ShowCheckMargin ToolStripDropDownMenu menu = this.zoomToolStripSplitButton.DropDown as ToolStripDropDownMenu; if (menu != null) { menu.ShowCheckMargin = true; menu.ShowImageMargin = false; menu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; } //Create the ToolStripControlHost ToolStripControlHost pageCounterItem = new ToolStripControlHost(pageCounter); pageCounterItem.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; this.toolStrip1.Items.Add(pageCounterItem); this.toolStrip1.Items.Add(this.pageToolStripLabel); // // Form1 // resources.ApplyResources(this, "$this"); this.Controls.Add(previewControl); this.Controls.Add(this.toolStrip1); this.ClientSize = new Size(400, 300); this.MinimizeBox = false; this.ShowInTaskbar = false; this.SizeGripStyle = SizeGripStyle.Hide; this.toolStrip1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pageCounter)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }