码迷,mamicode.com
首页 > 其他好文 > 详细

dev EditMask 设置方法

时间:2017-09-11 10:29:08      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:mask   play   from   exp   .com   nta   hand   ted   object   

官方帮助地址:

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 设置方法

标签:mask   play   from   exp   .com   nta   hand   ted   object   

原文地址:http://www.cnblogs.com/lhyqzx/p/7503184.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!