Browse Source

添加Enable字段

章政 7 years ago
parent
commit
ac2f0fbe14

+ 25 - 19
UAS-MES/CustomControl/TextBoxWithIcon/TextAreaForm.Designer.cs

@@ -29,29 +29,31 @@
         private void InitializeComponent()
         {   
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TextAreaForm));
-            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.TextArea = new System.Windows.Forms.TextBox();
             this.headBar1 = new UAS_MES.CustomControl.HeadBar();
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.Confirm = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.label1 = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
-            // textBox1
+            // TextArea
             // 
-            this.textBox1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.textBox1.Location = new System.Drawing.Point(1, 33);
-            this.textBox1.Multiline = true;
-            this.textBox1.Name = "textBox1";
-            this.textBox1.Size = new System.Drawing.Size(521, 263);
-            this.textBox1.TabIndex = 0;
+            this.TextArea.Font = new System.Drawing.Font("微软雅黑", 15F);
+            this.TextArea.Location = new System.Drawing.Point(1, 41);
+            this.TextArea.Margin = new System.Windows.Forms.Padding(4);
+            this.TextArea.Multiline = true;
+            this.TextArea.Name = "TextArea";
+            this.TextArea.Size = new System.Drawing.Size(693, 328);
+            this.TextArea.TabIndex = 0;
             // 
             // headBar1
             // 
             this.headBar1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
             this.headBar1.Dock = System.Windows.Forms.DockStyle.Top;
             this.headBar1.Location = new System.Drawing.Point(0, 0);
+            this.headBar1.Margin = new System.Windows.Forms.Padding(5);
             this.headBar1.Name = "headBar1";
-            this.headBar1.Size = new System.Drawing.Size(522, 32);
+            this.headBar1.Size = new System.Drawing.Size(696, 40);
             this.headBar1.TabIndex = 3;
             this.headBar1.Title = null;
             this.headBar1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.headBar1_MouseDown);
@@ -63,12 +65,13 @@
             this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
             this.Clean.Image = ((System.Drawing.Image)(resources.GetObject("Clean.Image")));
             this.Clean.IsShowBorder = true;
-            this.Clean.Location = new System.Drawing.Point(283, 302);
+            this.Clean.Location = new System.Drawing.Point(377, 378);
+            this.Clean.Margin = new System.Windows.Forms.Padding(4);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
             this.Clean.Power = null;
-            this.Clean.Size = new System.Drawing.Size(75, 23);
+            this.Clean.Size = new System.Drawing.Size(100, 29);
             this.Clean.TabIndex = 2;
             this.Clean.Text = "清除";
             this.Clean.UseVisualStyleBackColor = true;
@@ -81,12 +84,13 @@
             this.Confirm.DownImage = ((System.Drawing.Image)(resources.GetObject("Confirm.DownImage")));
             this.Confirm.Image = ((System.Drawing.Image)(resources.GetObject("Confirm.Image")));
             this.Confirm.IsShowBorder = true;
-            this.Confirm.Location = new System.Drawing.Point(160, 302);
+            this.Confirm.Location = new System.Drawing.Point(213, 378);
+            this.Confirm.Margin = new System.Windows.Forms.Padding(4);
             this.Confirm.MoveImage = ((System.Drawing.Image)(resources.GetObject("Confirm.MoveImage")));
             this.Confirm.Name = "Confirm";
             this.Confirm.NormalImage = ((System.Drawing.Image)(resources.GetObject("Confirm.NormalImage")));
             this.Confirm.Power = null;
-            this.Confirm.Size = new System.Drawing.Size(75, 23);
+            this.Confirm.Size = new System.Drawing.Size(100, 29);
             this.Confirm.TabIndex = 1;
             this.Confirm.Text = "确认";
             this.Confirm.UseVisualStyleBackColor = true;
@@ -97,25 +101,27 @@
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1.ForeColor = System.Drawing.SystemColors.ControlLightLight;
-            this.label1.Location = new System.Drawing.Point(9, 7);
+            this.label1.Location = new System.Drawing.Point(12, 9);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(74, 21);
+            this.label1.Size = new System.Drawing.Size(92, 27);
             this.label1.TabIndex = 4;
             this.label1.Text = "详细内容";
             // 
             // TextAreaForm
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.SystemColors.ControlDarkDark;
-            this.ClientSize = new System.Drawing.Size(522, 329);
+            this.ClientSize = new System.Drawing.Size(696, 411);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.headBar1);
             this.Controls.Add(this.Clean);
             this.Controls.Add(this.Confirm);
-            this.Controls.Add(this.textBox1);
+            this.Controls.Add(this.TextArea);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.KeyPreview = true;
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "TextAreaForm";
             this.Tag = "ShowDialogWindow";
             this.Text = "TextAreaForm";
@@ -128,7 +134,7 @@
 
         #endregion
 
-        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.TextBox TextArea;
         private ButtonUtil.NormalButton Confirm;
         private ButtonUtil.NormalButton Clean;
         private HeadBar headBar1;

+ 3 - 3
UAS-MES/CustomControl/TextBoxWithIcon/TextAreaForm.cs

@@ -90,7 +90,7 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
                 if (i == 0)
                 {
                     //将界面上输入的值填充到文本框中
-                    textBox1.Text = c.Controls[ControlName1[i]].Text;
+                    TextArea.Text = c.Controls[ControlName1[i]].Text;
                 }
                 else
                 {
@@ -113,7 +113,7 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
             {
                 if (i == 0)
                 {
-                    c.Controls[ControlName1[i]].Text = textBox1.Text;
+                    c.Controls[ControlName1[i]].Text = TextArea.Text;
                 }
                 else
                 {
@@ -126,7 +126,7 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
         //清除按钮
         private void Clean_Click(object sender, EventArgs e)
         {
-            textBox1.Clear(); 
+            TextArea.Clear(); 
         }
 
         private void TextAreaForm_KeyDown(object sender, KeyEventArgs e)

+ 9 - 5
UAS-MES/CustomControl/TextBoxWithIcon/TextBoxWithTextArea.Designer.cs

@@ -41,9 +41,10 @@
             this.TextAreaTextBox.ID = null;
             this.TextAreaTextBox.Location = new System.Drawing.Point(0, 0);
             this.TextAreaTextBox.Lock = false;
+            this.TextAreaTextBox.Margin = new System.Windows.Forms.Padding(4);
             this.TextAreaTextBox.Name = "TextAreaTextBox";
             this.TextAreaTextBox.Power = null;
-            this.TextAreaTextBox.Size = new System.Drawing.Size(173, 21);
+            this.TextAreaTextBox.Size = new System.Drawing.Size(229, 25);
             this.TextAreaTextBox.Str = null;
             this.TextAreaTextBox.Str1 = null;
             this.TextAreaTextBox.Str2 = null;
@@ -56,21 +57,24 @@
             this.TextAreaIcon.Cursor = System.Windows.Forms.Cursors.Hand;
             this.TextAreaIcon.Dock = System.Windows.Forms.DockStyle.Right;
             this.TextAreaIcon.Image = global::UAS_MES.Properties.Resources.notice_text_editor_16px_11373_easyicon_net;
-            this.TextAreaIcon.Location = new System.Drawing.Point(174, 0);
+            this.TextAreaIcon.Location = new System.Drawing.Point(232, 0);
+            this.TextAreaIcon.Margin = new System.Windows.Forms.Padding(4);
             this.TextAreaIcon.Name = "TextAreaIcon";
-            this.TextAreaIcon.Size = new System.Drawing.Size(19, 21);
+            this.TextAreaIcon.Size = new System.Drawing.Size(25, 26);
             this.TextAreaIcon.TabIndex = 1;
             this.TextAreaIcon.TabStop = false;
             this.TextAreaIcon.Click += new System.EventHandler(this.TextAreaIcon_Click);
             // 
             // TextBoxWithTextArea
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.Controls.Add(this.TextAreaIcon);
             this.Controls.Add(this.TextAreaTextBox);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "TextBoxWithTextArea";
-            this.Size = new System.Drawing.Size(193, 21);
+            this.Size = new System.Drawing.Size(257, 26);
+            this.Load += new System.EventHandler(this.TextBoxWithTextArea_Load);
             this.SizeChanged += new System.EventHandler(this.TextBoxWithTextArea_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.TextAreaIcon)).EndInit();
             this.ResumeLayout(false);

+ 38 - 0
UAS-MES/CustomControl/TextBoxWithIcon/TextBoxWithTextArea.cs

@@ -6,6 +6,11 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
 {
     public partial class TextBoxWithTextArea : UserControl
     {
+
+        bool TextBoxEnable1;
+
+        bool TextAreaEnable1;
+
         public TextBoxWithTextArea()
         {
             InitializeComponent();
@@ -24,12 +29,40 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
             }
         }
 
+        public bool TextBoxEnable
+        {
+            get
+            {
+                return TextBoxEnable1;
+            }
+
+            set
+            {
+                TextBoxEnable1 = value;
+            }
+        }
+
+        public bool TextAreaEnable
+        {
+            get
+            {
+                return TextAreaEnable1;
+            }
+
+            set
+            {
+                TextAreaEnable1 = value;
+            }
+        }
+
         private void TextAreaIcon_Click(object sender, EventArgs e)
         {
             //获取相对屏幕左上角的位置的坐标,传给TextAreaForm作为初始化的坐标
             var screenPoint = PointToScreen(TextAreaIcon.Location);
             bool GetParent = true;
             TextAreaForm taf = new TextAreaForm();
+            taf.Controls["TextArea"].Enabled = TextAreaEnable1;
+            taf.Controls["Clean"].Enabled = TextAreaEnable1;
             //需要传递当前的Form名称,控件名称,和相对屏幕的位置
             string FormName = this.FindForm().Name;
             int i = 0;
@@ -80,5 +113,10 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
         {
             TextAreaTextBox.Width = this.Width - TextAreaIcon.Width - 3;
         }
+
+        private void TextBoxWithTextArea_Load(object sender, EventArgs e)
+        {
+            TextAreaTextBox.Enabled = TextBoxEnable1;
+        }
     }
 }