internal void ApplyProperties(ControlProperties properties) { this.AutoEllipsis = properties.AutoEllipsis; this.AutoSize = properties.AutoSize; this.FlatStyle = properties.FlatStyle; this.ForeColor = properties.ForeColor; this.RightToLeft = properties.RightToLeft; this.TextAlign = properties.TextAlign; }
public ComboBox() { InitializeControlStyle(); InitializeComponent(); ctrlProperties = new ControlProperties(); ctrlProperties.PropertyChanged += new EventHandler(controlProperties_PropertyChanged); dropDownControl = new ListControl(this); this.ForeColor = dropDownControl.ForeColor; dropDown = new Popup(dropDownControl); dropDown.PopupHide += new EventHandler(dropDown_PopupHide); dropDown.Resizable = true; scrollBar = dropDownControl.ScrollBar; scrollBar.Scroll += new EventHandler(scrollBar_Scroll); scrollBar.ValueChanged += new EventHandler(scrollBar_ValueChanged); penEnter = new Pen(new SolidBrush(System.Drawing.SystemColors.Highlight), 1.4F); penLeave = new Pen(new SolidBrush(Color.White), 1.4F); items = new List <string>(); base.Text = string.Empty; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); ScreenshotUtils.ControlExt.ControlProperties controlProperties2 = new ScreenshotUtils.ControlExt.ControlProperties(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CaptureForm)); this.plTool = new System.Windows.Forms.Panel(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.picSplit = new System.Windows.Forms.PictureBox(); this.btnOut = new ScreenshotUtils.ControlExt.ToolButton(); this.btnFinish = new ScreenshotUtils.ControlExt.ToolButton(); this.btnClose = new ScreenshotUtils.ControlExt.ToolButton(); this.btnSave = new ScreenshotUtils.ControlExt.ToolButton(); this.btnReset = new ScreenshotUtils.ControlExt.ToolButton(); this.btnText = new ScreenshotUtils.ControlExt.ToolButton(); this.btnBrush = new ScreenshotUtils.ControlExt.ToolButton(); this.btnArrow = new ScreenshotUtils.ControlExt.ToolButton(); this.btnEllipse = new ScreenshotUtils.ControlExt.ToolButton(); this.btnRect = new ScreenshotUtils.ControlExt.ToolButton(); this.plColorBox = new System.Windows.Forms.Panel(); this.fontBox = new ScreenshotUtils.ControlExt.ComboBox(); this.btnSmall = new ScreenshotUtils.ControlExt.ToolButton(); this.btnLarge = new ScreenshotUtils.ControlExt.ToolButton(); this.btnMiddle = new ScreenshotUtils.ControlExt.ToolButton(); this.colorBox = new ScreenshotUtils.ControlExt.ColorBox(); this.tBtn_TextFont = new ScreenshotUtils.ControlExt.ToolButton(); this.txtDrawText = new lxzh.TextInput(); this.imageProcessBox = new ScreenshotUtils.ControlExt.ImageProcessBox(); this.plTool.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picSplit)).BeginInit(); this.plColorBox.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.fontBox)).BeginInit(); this.SuspendLayout(); // // plTool // this.plTool.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(238)))), ((int)(((byte)(255))))); this.plTool.Controls.Add(this.pictureBox1); this.plTool.Controls.Add(this.picSplit); this.plTool.Controls.Add(this.btnOut); this.plTool.Controls.Add(this.btnFinish); this.plTool.Controls.Add(this.btnClose); this.plTool.Controls.Add(this.btnSave); this.plTool.Controls.Add(this.btnReset); this.plTool.Controls.Add(this.btnText); this.plTool.Controls.Add(this.btnBrush); this.plTool.Controls.Add(this.btnArrow); this.plTool.Controls.Add(this.btnEllipse); this.plTool.Controls.Add(this.btnRect); this.plTool.Font = new System.Drawing.Font("宋体", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.plTool.Location = new System.Drawing.Point(16, 60); this.plTool.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.plTool.Name = "plTool"; this.plTool.Size = new System.Drawing.Size(404, 38); this.plTool.TabIndex = 1; this.plTool.Visible = false; // // pictureBox1 // this.pictureBox1.Image = global::ScreenshotUtils.Properties.Resources.separator; this.pictureBox1.Location = new System.Drawing.Point(163, 10); this.pictureBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(3, 18); this.pictureBox1.TabIndex = 12; this.pictureBox1.TabStop = false; // // picSplit // this.picSplit.Image = global::ScreenshotUtils.Properties.Resources.separator; this.picSplit.Location = new System.Drawing.Point(291, 9); this.picSplit.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.picSplit.Name = "picSplit"; this.picSplit.Size = new System.Drawing.Size(3, 18); this.picSplit.TabIndex = 10; this.picSplit.TabStop = false; // // btnOut // this.btnOut.BtnImage = global::ScreenshotUtils.Properties.Resources._out; this.btnOut.IsSelected = false; this.btnOut.IsSelectedBtn = false; this.btnOut.IsSingleSelectedBtn = false; this.btnOut.Location = new System.Drawing.Point(197, 5); this.btnOut.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.btnOut.Name = "btnOut"; this.btnOut.Size = new System.Drawing.Size(22, 22); this.btnOut.TabIndex = 11; this.btnOut.TipText = "桌面显示"; this.btnOut.Click += new System.EventHandler(this.btnSticky_Click); // // btnFinish // this.btnFinish.BtnImage = global::ScreenshotUtils.Properties.Resources.ok; this.btnFinish.IsSelected = false; this.btnFinish.IsSelectedBtn = false; this.btnFinish.IsSingleSelectedBtn = false; this.btnFinish.Location = new System.Drawing.Point(293, 5); this.btnFinish.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.btnFinish.Name = "btnFinish"; this.btnFinish.Size = new System.Drawing.Size(57, 22); this.btnFinish.TabIndex = 8; this.btnFinish.Text = "完成"; this.btnFinish.TipText = "完成截图"; this.btnFinish.Click += new System.EventHandler(this.tBtn_Finish_Click); // // btnClose // this.btnClose.BtnImage = global::ScreenshotUtils.Properties.Resources.close; this.btnClose.IsSelected = false; this.btnClose.IsSelectedBtn = false; this.btnClose.IsSingleSelectedBtn = false; this.btnClose.Location = new System.Drawing.Point(261, 5); this.btnClose.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.btnClose.Name = "btnClose"; this.btnClose.Size = new System.Drawing.Size(22, 22); this.btnClose.TabIndex = 7; this.btnClose.TipText = "退出截图"; // // btnSave // this.btnSave.BtnImage = global::ScreenshotUtils.Properties.Resources.save; this.btnSave.IsSelected = false; this.btnSave.IsSelectedBtn = false; this.btnSave.IsSingleSelectedBtn = false; this.btnSave.Location = new System.Drawing.Point(229, 5); this.btnSave.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.btnSave.Name = "btnSave"; this.btnSave.Size = new System.Drawing.Size(22, 22); this.btnSave.TabIndex = 6; this.btnSave.TipText = "保存Ctrl+S"; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // // btnReset // this.btnReset.BtnImage = global::ScreenshotUtils.Properties.Resources.cancel; this.btnReset.IsSelected = false; this.btnReset.IsSelectedBtn = false; this.btnReset.IsSingleSelectedBtn = false; this.btnReset.Location = new System.Drawing.Point(165, 4); this.btnReset.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.btnReset.Name = "btnReset"; this.btnReset.Size = new System.Drawing.Size(22, 22); this.btnReset.TabIndex = 5; this.btnReset.TipText = "撤销编辑Ctrl+Z"; this.btnReset.Click += new System.EventHandler(this.btnReset_Click); // // btnText // this.btnText.BtnImage = global::ScreenshotUtils.Properties.Resources.text; this.btnText.IsSelected = false; this.btnText.IsSelectedBtn = true; this.btnText.IsSingleSelectedBtn = false; this.btnText.Location = new System.Drawing.Point(132, 5); this.btnText.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.btnText.Name = "btnText"; this.btnText.Size = new System.Drawing.Size(22, 22); this.btnText.TabIndex = 4; this.btnText.TipText = "文字工具"; // // btnBrush // this.btnBrush.BtnImage = global::ScreenshotUtils.Properties.Resources.brush; this.btnBrush.IsSelected = false; this.btnBrush.IsSelectedBtn = true; this.btnBrush.IsSingleSelectedBtn = false; this.btnBrush.Location = new System.Drawing.Point(100, 5); this.btnBrush.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.btnBrush.Name = "btnBrush"; this.btnBrush.Size = new System.Drawing.Size(22, 22); this.btnBrush.TabIndex = 3; this.btnBrush.TipText = "画刷工具"; // // btnArrow // this.btnArrow.BtnImage = global::ScreenshotUtils.Properties.Resources.arrow; this.btnArrow.IsSelected = false; this.btnArrow.IsSelectedBtn = true; this.btnArrow.IsSingleSelectedBtn = false; this.btnArrow.Location = new System.Drawing.Point(68, 4); this.btnArrow.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.btnArrow.Name = "btnArrow"; this.btnArrow.Size = new System.Drawing.Size(22, 22); this.btnArrow.TabIndex = 2; this.btnArrow.TipText = "箭头工具"; // // btnEllipse // this.btnEllipse.BtnImage = global::ScreenshotUtils.Properties.Resources.ellips; this.btnEllipse.IsSelected = false; this.btnEllipse.IsSelectedBtn = true; this.btnEllipse.IsSingleSelectedBtn = false; this.btnEllipse.Location = new System.Drawing.Point(36, 4); this.btnEllipse.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.btnEllipse.Name = "btnEllipse"; this.btnEllipse.Size = new System.Drawing.Size(22, 22); this.btnEllipse.TabIndex = 1; this.btnEllipse.TipText = "椭圆工具"; // // btnRect // this.btnRect.BtnImage = global::ScreenshotUtils.Properties.Resources.rect; this.btnRect.IsSelected = false; this.btnRect.IsSelectedBtn = true; this.btnRect.IsSingleSelectedBtn = false; this.btnRect.Location = new System.Drawing.Point(4, 4); this.btnRect.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.btnRect.Name = "btnRect"; this.btnRect.Size = new System.Drawing.Size(22, 22); this.btnRect.TabIndex = 0; this.btnRect.TipText = "矩形工具"; // // plColorBox // this.plColorBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(238)))), ((int)(((byte)(255))))); this.plColorBox.Controls.Add(this.fontBox); this.plColorBox.Controls.Add(this.btnSmall); this.plColorBox.Controls.Add(this.btnLarge); this.plColorBox.Controls.Add(this.btnMiddle); this.plColorBox.Controls.Add(this.colorBox); this.plColorBox.Controls.Add(this.tBtn_TextFont); this.plColorBox.Location = new System.Drawing.Point(16, 142); this.plColorBox.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.plColorBox.Name = "plColorBox"; this.plColorBox.Size = new System.Drawing.Size(265, 40); this.plColorBox.TabIndex = 2; this.plColorBox.Visible = false; // // fontBox // this.fontBox.BackColor = System.Drawing.Color.White; controlProperties2.ForeColor = System.Drawing.SystemColors.ControlText; this.fontBox.CtrlProperties = controlProperties2; this.fontBox.ForeColor = System.Drawing.SystemColors.ControlText; this.fontBox.Items = ((System.Collections.Generic.List <string>)(resources.GetObject("fontBox.Items"))); this.fontBox.Location = new System.Drawing.Point(35, 9); this.fontBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.fontBox.Name = "fontBox"; this.fontBox.Size = new System.Drawing.Size(57, 22); this.fontBox.TabIndex = 6; this.fontBox.TabStop = false; this.fontBox.Text = "10"; // // btnSmall // this.btnSmall.BtnImage = global::ScreenshotUtils.Properties.Resources.small; this.btnSmall.IsSelected = true; this.btnSmall.IsSelectedBtn = true; this.btnSmall.IsSingleSelectedBtn = true; this.btnSmall.Location = new System.Drawing.Point(5, 8); this.btnSmall.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.btnSmall.Name = "btnSmall"; this.btnSmall.Size = new System.Drawing.Size(22, 22); this.btnSmall.TabIndex = 4; this.btnSmall.TipText = ""; // // btnLarge // this.btnLarge.BtnImage = global::ScreenshotUtils.Properties.Resources.large; this.btnLarge.IsSelected = false; this.btnLarge.IsSelectedBtn = true; this.btnLarge.IsSingleSelectedBtn = true; this.btnLarge.Location = new System.Drawing.Point(67, 8); this.btnLarge.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.btnLarge.Name = "btnLarge"; this.btnLarge.Size = new System.Drawing.Size(22, 22); this.btnLarge.TabIndex = 3; this.btnLarge.TipText = ""; // // btnMiddle // this.btnMiddle.BtnImage = global::ScreenshotUtils.Properties.Resources.middle; this.btnMiddle.IsSelected = false; this.btnMiddle.IsSelectedBtn = true; this.btnMiddle.IsSingleSelectedBtn = true; this.btnMiddle.Location = new System.Drawing.Point(35, 8); this.btnMiddle.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.btnMiddle.Name = "btnMiddle"; this.btnMiddle.Size = new System.Drawing.Size(22, 22); this.btnMiddle.TabIndex = 2; this.btnMiddle.TipText = ""; // // colorBox // this.colorBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(238)))), ((int)(((byte)(255))))); this.colorBox.Location = new System.Drawing.Point(99, 0); this.colorBox.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.colorBox.Name = "colorBox"; this.colorBox.Size = new System.Drawing.Size(165, 35); this.colorBox.TabIndex = 0; this.colorBox.Text = "colorBox1"; // // tBtn_TextFont // this.tBtn_TextFont.BtnImage = global::ScreenshotUtils.Properties.Resources.text; this.tBtn_TextFont.IsSelected = false; this.tBtn_TextFont.IsSelectedBtn = true; this.tBtn_TextFont.IsSingleSelectedBtn = false; this.tBtn_TextFont.Location = new System.Drawing.Point(5, 8); this.tBtn_TextFont.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.tBtn_TextFont.Name = "tBtn_TextFont"; this.tBtn_TextFont.Size = new System.Drawing.Size(22, 22); this.tBtn_TextFont.TabIndex = 5; this.tBtn_TextFont.TipText = ""; this.tBtn_TextFont.Visible = false; // // txtDrawText // this.txtDrawText.BackColor = System.Drawing.Color.White; this.txtDrawText.BorderStyle = System.Windows.Forms.BorderStyle.None; this.txtDrawText.Location = new System.Drawing.Point(137, 12); this.txtDrawText.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.txtDrawText.Multiline = true; this.txtDrawText.Name = "txtDrawText"; this.txtDrawText.Size = new System.Drawing.Size(163, 42); this.txtDrawText.TabIndex = 5; this.txtDrawText.Visible = false; this.txtDrawText.TextChanged += new System.EventHandler(this.txtDrawText_TextChanged); this.txtDrawText.Validating += new System.ComponentModel.CancelEventHandler(this.txtDrawText_Validating); // // imageProcessBox // this.imageProcessBox.BackColor = System.Drawing.Color.Transparent; this.imageProcessBox.BaseImage = null; this.imageProcessBox.CanReset = true; this.imageProcessBox.Cursor = System.Windows.Forms.Cursors.Default; this.imageProcessBox.Dock = System.Windows.Forms.DockStyle.Fill; this.imageProcessBox.DotColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(174)))), ((int)(((byte)(255))))); this.imageProcessBox.Font = new System.Drawing.Font("微软雅黑", 6.6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.imageProcessBox.ForeColor = System.Drawing.Color.White; this.imageProcessBox.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(174)))), ((int)(((byte)(255))))); this.imageProcessBox.Location = new System.Drawing.Point(0, 0); this.imageProcessBox.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.imageProcessBox.Name = "imageProcessBox"; this.imageProcessBox.SelectedRect = new System.Drawing.Rectangle(-100, -100, 45, 45); this.imageProcessBox.Size = new System.Drawing.Size(484, 309); this.imageProcessBox.TabIndex = 0; this.imageProcessBox.Text = "imageProcessBox"; this.imageProcessBox.Click += new System.EventHandler(this.imageProcessBox_Click); this.imageProcessBox.Paint += new System.Windows.Forms.PaintEventHandler(this.imageProcessBox_Paint); this.imageProcessBox.DoubleClick += new System.EventHandler(this.imageProcessBox_DoubleClick); this.imageProcessBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this.imageProcessBox_MouseDown); this.imageProcessBox.MouseMove += new System.Windows.Forms.MouseEventHandler(this.imageProcessBox_MouseMove); this.imageProcessBox.MouseUp += new System.Windows.Forms.MouseEventHandler(this.imageProcessBox_MouseUp); // // CaptureForm // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(484, 309); this.Controls.Add(this.txtDrawText); this.Controls.Add(this.plColorBox); this.Controls.Add(this.plTool); this.Controls.Add(this.imageProcessBox); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.KeyPreview = true; this.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); this.Name = "CaptureForm"; this.ShowIcon = false; this.ShowInTaskbar = false; this.Text = "FrmCapture"; this.TopMost = true; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.CaptureForm_FormClosed); this.Load += new System.EventHandler(this.CaptureForm_Load); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CaptureForm_KeyDown); this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.CaptureForm_MouseMove); this.plTool.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.picSplit)).EndInit(); this.plColorBox.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.fontBox)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }