caosy преди 6 години
родител
ревизия
729c1b7616

+ 2 - 1
UAS-MES/CustomControl/TextBoxWithIcon/TextBoxWithPlaceHolder.Designer.cs

@@ -40,13 +40,14 @@
             this.TextBox.Location = new System.Drawing.Point(0, 0);
             this.TextBox.Name = "TextBox";
             this.TextBox.Power = null;
-            this.TextBox.Size = new System.Drawing.Size(241, 25);
+            this.TextBox.Size = new System.Drawing.Size(241, 21);
             this.TextBox.Str = null;
             this.TextBox.Str1 = null;
             this.TextBox.Str2 = null;
             this.TextBox.TabIndex = 0;
             this.TextBox.TextChanged += new System.EventHandler(this.TextBox_TextChanged);
             this.TextBox.Enter += new System.EventHandler(this.TextBox_Enter);
+            this.TextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBox_KeyDown);
             this.TextBox.Leave += new System.EventHandler(this.TextBox_Leave);
             // 
             // TextBoxWithPlaceHolder

+ 10 - 0
UAS-MES/CustomControl/TextBoxWithIcon/TextBoxWithPlaceHolder.cs

@@ -43,6 +43,11 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
 
         public event OnTextChange UserControlTextChanged;
 
+
+        public delegate void OnKeydown(object sender, EventArgs e);
+
+        public event OnKeydown UserControlKeydown;
+
         public TextBoxWithPlaceHolder()
         {
             InitializeComponent();
@@ -80,5 +85,10 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
         {
             UserControlTextChanged?.Invoke(sender, new EventArgs());
         }
+
+        private void TextBox_KeyDown(object sender, KeyEventArgs e)
+        {
+            UserControlKeydown?.Invoke(sender, e);
+        }
     }
 }