using System; using System.Collections; using System.Drawing; using System.Windows.Forms; namespace PaintDotNet.DedicatedAnalysis.menuGrayiron { public partial class ChangeParameter : PdnBaseForm { /// /// 调色板 /// PaintDotNet.ColorsForm colorsForm1; /// /// 下拉框默认值 /// private static String num= "14" ; /// /// 颜色默认值 /// private static Color color =Color.Black ; private NumericUpDown numericUpDown1; private ToolTip toolTip1; /// /// Required designer variable. /// private System.ComponentModel.IContainer components = null; public ChangeParameter() { InitializeComponent(); InitializeLanguageText(); } #region Windows Form Designer generated code private void InitializeLanguageText() { this.groupBox1.Text = PdnResources.GetString("Menu.operation.text"); this.button2.Text = PdnResources.GetString("CommonAction.Save"); this.button1.Text = PdnResources.GetString("Menu.File.Close.Text"); this.groupBox2.Text = PdnResources.GetString("Menu.Colorsetting.text"); this.label2.Text = PdnResources.GetString("Menu.color.text") + ":"; this.label1.Text = PdnResources.GetString("Menu.Fontsize.text") + ":"; this.Text = PdnResources.GetString("Menu.Displayparamssettings.text"); } /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.button2 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); this.panel1 = new System.Windows.Forms.Panel(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); this.SuspendLayout(); // // groupBox1 // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox1.Controls.Add(this.button2); this.groupBox1.Controls.Add(this.button1); this.groupBox1.Location = new System.Drawing.Point(12, 12); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(486, 60); this.groupBox1.TabIndex = 1; this.groupBox1.TabStop = false; // // button2 // this.button2.AutoEllipsis = true; this.button2.Location = new System.Drawing.Point(390, 15); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(90, 30); this.button2.TabIndex = 1; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // button1 // this.button1.AutoEllipsis = true; this.button1.Location = new System.Drawing.Point(294, 15); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(90, 30); this.button1.TabIndex = 0; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // groupBox2 // this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox2.Controls.Add(this.numericUpDown1); this.groupBox2.Controls.Add(this.panel1); this.groupBox2.Controls.Add(this.label2); this.groupBox2.Controls.Add(this.label1); this.groupBox2.Location = new System.Drawing.Point(12, 78); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(486, 137); this.groupBox2.TabIndex = 2; this.groupBox2.TabStop = false; // // numericUpDown1 // this.numericUpDown1.Location = new System.Drawing.Point(55, 46); this.numericUpDown1.Maximum = new decimal(new int[] { 49000, 0, 0, 0}); this.numericUpDown1.Minimum = new decimal(new int[] { 1, 0, 0, 0}); this.numericUpDown1.Name = "numericUpDown1"; this.numericUpDown1.Size = new System.Drawing.Size(120, 21); this.numericUpDown1.TabIndex = 4; this.numericUpDown1.Value = new decimal(new int[] { 12, 0, 0, 0}); // // panel1 // this.panel1.BackColor = System.Drawing.Color.Black; this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel1.ForeColor = System.Drawing.Color.Black; this.panel1.Location = new System.Drawing.Point(252, 46); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(121, 20); this.panel1.TabIndex = 3; this.panel1.Click += new System.EventHandler(this.panel1_Click); // // label2 // this.label2.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label2.Location = new System.Drawing.Point(198, 49); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(45, 14); this.label2.TabIndex = 1; // // label1 // this.label1.AutoEllipsis = true; this.label1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.Location = new System.Drawing.Point(7, 49); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(45, 14); this.label1.TabIndex = 0; // // ChangeParameter // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoSize = true; this.BackColor = System.Drawing.SystemColors.Control; this.ClientSize = new System.Drawing.Size(502, 227); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ChangeParameter"; this.Load += new System.EventHandler(this.ChangeParameter_Load); this.Controls.SetChildIndex(this.groupBox1, 0); this.Controls.SetChildIndex(this.groupBox2, 0); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button1; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label1; private System.Windows.Forms.Panel panel1; private void panel1_Click(object sender, System.EventArgs e) { this.colorsForm1.UserPrimaryColor = ColorBgra.FromColor(this.panel1.BackColor); this.colorsForm1.setSaveBtn_Click(new System.EventHandler(this.colorsForm1Changed)); this.colorsForm1.ShowDialog(); } private void colorsForm1Changed(object sender, EventArgs e) { this.panel1.BackColor = this.colorsForm1.UserPrimaryColor.ToColor(); this.colorsForm1.Close(); } private void ChangeParameter_Load(object sender, EventArgs e) { InitOtherTools(); changeSize(); } // //初始化其他控件 // private void InitOtherTools() { // //调色板 // this.colorsForm1 = new ColorsForm(); this.colorsForm1.StartPosition = FormStartPosition.CenterScreen; this.colorsForm1.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged); } private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce) { } private void button1_Click(object sender, EventArgs e) { this.Close(); } private void button2_Click(object sender, EventArgs e) { GrayironDialog.fontColor = panel1.BackColor; GrayironDialog.fontSize= numericUpDown1.Text; this.Close(); } private void changeSize() { if (GrayironDialog.fontSize !=null && GrayironDialog.fontColor!=null) { this.numericUpDown1.Text= GrayironDialog.fontSize; this.panel1.BackColor= GrayironDialog.fontColor; } } } }