当前位置: 首页>>代码示例>>C#>>正文


C# TextEdit.Focus方法代码示例

本文整理汇总了C#中TextEdit.Focus方法的典型用法代码示例。如果您正苦于以下问题:C# TextEdit.Focus方法的具体用法?C# TextEdit.Focus怎么用?C# TextEdit.Focus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TextEdit的用法示例。


在下文中一共展示了TextEdit.Focus方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TextControlNotNull

 public static void TextControlNotNull(TextEdit textEdit, string title)
 {
     textEdit.Properties.Appearance.BorderColor = System.Drawing.Color.Red; 
     MessageBox.Show(string.Format("{0} không được để trống!", title), Resources.MessageBoxErrorMessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
     textEdit.Focus();
     textEdit.SelectAll();
 }
开发者ID:cuongpv88,项目名称:work,代码行数:7,代码来源:Ultils.cs

示例2: EditTextErrorMessage

 public static void EditTextErrorMessage(TextEdit textEdit, string title)
 {
     textEdit.Properties.Appearance.BorderColor = System.Drawing.Color.Red;
     MessageBox.Show(string.Format("Error! {0}", title), Resources.MessageBoxErrorMessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
     textEdit.Focus();
     textEdit.SelectAll();
 }
开发者ID:cuongpv88,项目名称:work,代码行数:7,代码来源:Ultils.cs

示例3: SetColorErrorTextControl

 public static void SetColorErrorTextControl(TextEdit textEdit, string title)
 {
     textEdit.Properties.Appearance.BorderColor = System.Drawing.Color.Red;
     textEdit.Focus();
     textEdit.SelectAll();
     MessageBox.Show(title, Resources.MessageBoxErrorMessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
 }
开发者ID:cuongpv88,项目名称:work,代码行数:7,代码来源:Ultils.cs

示例4: ValidationTextEditNullValueMessage

 public static bool ValidationTextEditNullValueMessage(TextEdit textEdit, string messageTitle)
 {
     if (string.IsNullOrEmpty(textEdit.Text))
     {
         textEdit.Properties.Appearance.BorderColor = Color.Red;
         textEdit.Focus();
         textEdit.SelectAll();
         return false;
     }
     return true;
 }
开发者ID:cuongpv88,项目名称:work,代码行数:11,代码来源:CheckEditTextBoxNullValue.cs

示例5: ValidationTextEditNullValueWidthErrorProvider

        /// <summary>
        /// Not good reset default
        /// </summary>
        /// <param name="textEdit"></param>
        /// <param name="errorMessage"></param>
        /// <returns></returns>
        public static bool ValidationTextEditNullValueWidthErrorProvider(TextEdit textEdit, string errorMessage)
        {
            if (string.IsNullOrEmpty(textEdit.Text))
            {
                DXErrorProvider dxErrorProvider = new DXErrorProvider();

                textEdit.Properties.Appearance.BorderColor = Color.Red;
                textEdit.Focus();

                dxErrorProvider.SetError(textEdit, errorMessage);
                return false;
            }

            return true;
        }
开发者ID:cuongpv88,项目名称:work,代码行数:21,代码来源:CheckEditTextBoxNullValue.cs

示例6: UniversalFunction

 private void UniversalFunction(PreviewKeyDownEventArgs e, object btn, TextEdit txtID, string operation, TextEdit NextFocus, string msg)
 {
     string id = "";
     if (e.KeyCode == Keys.F10)
     {
         AllPickListButtons_Click(btn, e);
     }
     else if (e.KeyCode == Keys.Enter)
     {
         if (txtID.Text != "" && !txtID.Text.Contains("-"))
         {
             if (txtID == txtDSSID)
             {
                 id = string.Format("{0:000000}", Convert.ToInt32(txtID.Text)) + "-" + GlobalVar.g_WorkDate.Remove(0, 8);
             }
             else if (txtID == txtCompanyID)
             {
                 id = string.Format("{0:000}", Convert.ToInt32(txtID.Text));
             }
             else if (txtID != txtAccountNo)
             {
                 id = string.Format("{0:000000}", Convert.ToInt32(txtID.Text));
             }
             txtID.Text = id;
             string ID = obj_bllChequeWithoutSummary.Verify(txtID.Text, operation);
             if (ID != "")
             {
                 if (txtID == txtEmployeeID)
                 {
                     txtEmployeeName.Text = ID;
                 }
                 if (txtID == txtAccountNo)
                 {
                     txtAccountTitle.Text = ID;
                 }
                 if (txtID == txtSpoID)
                 {
                     grdInvoiceAdjustments.Focus();
                 }
                 else if (NextFocus == txtDSSID)
                 {
                     txtDueDate.Focus();
                 }
                 else
                 {
                     NextFocus.Focus();
                 }
             }
             else
             {
                 GlobalVar.MB(msg, MessageBoxIcon.Warning);
                 txtID.Text = "";
                 if (txtID == txtEmployeeID)
                 {
                     txtEmployeeName.Text = "";
                 }
                 if (txtID == txtAccountNo)
                 {
                     txtAccountTitle.Text = "";
                 }
                 txtID.Focus();
             }
         }
     }
     else if (e.KeyCode == Keys.Back || e.KeyCode == Keys.Insert || e.KeyCode == Keys.Delete || e.KeyCode == Keys.Up || e.KeyCode == Keys.Down || e.KeyCode == Keys.Left || e.KeyCode == Keys.Right || txtCompanyID.SelectionLength > 0)
     {
         txtID.Text = "";
         txtID.Focus();
     }
 }
开发者ID:ahmadmujtaba,项目名称:BMC,代码行数:70,代码来源:frmChequeEntry.cs

示例7: EditTextErrorNoMessage

 public static void EditTextErrorNoMessage(TextEdit textEdit)
 {
     textEdit.Properties.Appearance.BorderColor = System.Drawing.Color.Red;
     textEdit.Focus();
     textEdit.SelectAll();
 }
开发者ID:cuongpv88,项目名称:work,代码行数:6,代码来源:Ultils.cs

示例8: SetColorErrorTextControl

 /// <summary>
 /// 
 /// </summary>
 /// <param name="textEdit"></param>
 public static void SetColorErrorTextControl(TextEdit textEdit)
 {
     textEdit.Properties.Appearance.BorderColor = Color.Red;
     textEdit.Focus();
     textEdit.SelectAll();
 }
开发者ID:cuongpv88,项目名称:work,代码行数:10,代码来源:CheckEditTextBoxNullValue.cs

示例9: ValidarEmail

        //Para verficiar que los Email esten Escrito Correctamente
        public static bool ValidarEmail(TextEdit Txt)
        {
            bool flag;

            if (Txt.Text != string.Empty)
            {
                if (System.Text.RegularExpressions.Regex.IsMatch(Txt.Text, @"^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"))
                {
                    flag = true;
                }
                else
                {
                    flag = false;
                    Txt.Focus();
                }
            }
            else
            {
                flag = false;
            }

            return flag;
        }
开发者ID:dpolanco1,项目名称:SmarthClinic,代码行数:24,代码来源:Controles.cs


注:本文中的TextEdit.Focus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。