关于XtraEditors的ComboxEditor、TextboxEditor和ButtonEditor 的使用总结

 

//关于XtraEditors的ComboxEditor、TextboxEditor和ButtonEditor 的使用总结
//使用这三种控件必须引入using DevExpress.XtraEditors;

//1、ComBoxEditor:
    comboBoxEdit_conditions.Properties.Items.AddRange(role);//绑定ComboxEditor 其中Role为数组
    comboBoxEdit_conditions.SelectedIndex = 0;//设置默认选中的Item
    comboBoxEdit_conditions.Properties.ImmediatePopup = true;//按任意字母后ComboxEditor展开
    comboBoxEdit_conditions.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;//设置其为只读
    
     this.comboBoxEdit_conditions.Select();//激活控件 同样适用于其他控件
     this.comboBoxEdit_conditions.Focus();//设置可编辑焦点 同上
     this.comboBoxEdit_conditions.ShowPopup();//使ComboxEditor展开

//2、TextboxEditor:
   this.textEdit_ByCode.Select();
   this.textEdit_ByCode.Focus();
   this.textEdit_ByCode.SelectAll();//选中Editor区域的所有文本

//3、ButtonEditor: 
 this.buttonEdit_Input.Location = new System.Drawing.Point(136, 29);
 this.buttonEdit_Input.Name = "buttonEdit_Input";
 this.buttonEdit_Input.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
 new DevExpress.XtraEditors.Controls.EditorButton()});	//添加EditorButton(外观是方框三点Eillips)
 this.buttonEdit_Input.Properties.Mask.EditMask = "//d{6}//|//d{6}//|//w{2,3}";//正则表达式
 this.buttonEdit_Input.Properties.Mask.IgnoreMaskBlank = false;
 this.buttonEdit_Input.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.RegEx;//正则类型
 this.buttonEdit_Input.Properties.Mask.UseMaskAsDisplayFormat = true;
 this.buttonEdit_Input.Size = new System.Drawing.Size(168, 21);
 this.buttonEdit_Input.TabIndex = 0;
 this.buttonEdit_Input.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.buttonEdit_Input_KeyPress);
 this.buttonEdit_Input.ButtonPressed += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(this.buttonEdit_Input_ButtonPressed);//ButtonEditor的按钮事件
     

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值