官方帮助地址:

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(, , , );
gridView1.Appearance.OddRow.BackColor = Color.FromArgb(, , , );
gridView1.Appearance.SelectedRow.BackColor = Color.FromArgb(, , , );
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 >= )
{
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;
}
}
}
05-25 16:32