dev EditMask 设置方法

Posted _ali

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了dev EditMask 设置方法相关的知识,希望对你有一定的参考价值。

官方帮助地址:

https://documentation.devexpress.com/WindowsForms/583/Controls-and-Libraries/Editors-and-Simple-Controls/Simple-Editors/Concepts/Masks/Mask-Editors-Overview

代码实例:

            RepositoryItemTextEdit repositoryItemTextEdit1 = new RepositoryItemTextEdit();
            repositoryItemTextEdit1.Mask.EditMask = "\\d{0,}\\.[0,5]|\\d{0,}";
            repositoryItemTextEdit1.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.RegEx;

Dev控件之GridControl行色变化  

//1、隔行换色,在fromLoad中以下代码
gridView1.Appearance.EvenRow.BackColor = Color.FromArgb(150, 254, 253, 236);
gridView1.Appearance.OddRow.BackColor = Color.FromArgb(150, 240, 236, 253);
gridView1.Appearance.SelectedRow.BackColor = Color.FromArgb(100, 207, 255, 220);
gridView1.OptionsView.EnableAppearanceEvenRow = true;
gridView1.OptionsView.EnableAppearanceOddRow = true;
//2、按条件换色

string sCol = "";           //列值
bool bColor = true;      //当前色
 private void gridView1_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)
 {
            GridView View = sender as GridView;
            if (e.RowHandle >= 0)
            {
                string c1 = View.GetRowCellDisplayText(e.RowHandle, View.Columns["c2"]);
                if (c1 != sCol)
                {
                    bColor = !bColor;
                    sCol = c1;
                }
                if (bColor)
                {
                    e.Appearance.BackColor = Color.Salmon;
                    e.Appearance.BackColor2 = Color.SeaShell;
                }
                else
                {                  
                   e.Appearance.BackColor = Color.Gold;
                   e.Appearance.BackColor2 = Color.LightGoldenrodYellow;
                }        
           }                        
}

 

以上是关于dev EditMask 设置方法的主要内容,如果未能解决你的问题,请参考以下文章

c_cpp 快速代码片段,用于在统计(阻止)/ dev / rdsk中的设备时验证fstat64和stat64的行为。

VSCode自定义代码片段—— 数组的响应式方法

VSCode自定义代码片段10—— 数组的响应式方法

powerbuilder里面如何把editmask中输入的字符串类型如何转换成datetime啊用来比较和datetime类型的大小 !

Delphi maskedit控件的掩码含义及用法方法

Dev-C++设置语言标准