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

Devexpress DropDownButton 用法

时间:2015-01-30 09:15:28      阅读:1401      评论:0      收藏:0      [点我收藏+]

标签:

 public partial class XtraForm2 : DevExpress.XtraEditors.XtraForm
    {
        public XtraForm2()
        {
            InitializeComponent();
            CreateDropDownControl();
        }
        private void CreateDropDownControl()
        {
            DropDownButton btn = new DropDownButton();
            btn.Text = "Click here";
            btn.DropDownControl = CreateDXPopupMenu();
            btn.Location = new Point(100, 200);
            Controls.Add(btn);
        }
        private DXPopupMenu CreateDXPopupMenu()
        {
            DXPopupMenu menu = new DXPopupMenu();
            menu.Items.Add(new DXMenuItem("Item", OnItemClick));
            menu.Items.Add(new DXMenuCheckItem("CheckItem", false, null, OnItemClick));
            DXSubMenuItem subMenu = new DXSubMenuItem("SubMenu");
            subMenu.Items.Add(new DXMenuItem("SubItem", OnItemClick));
            menu.Items.Add(subMenu);
            return menu;
        }
        private void OnItemClick(object sender, EventArgs e)
        {
            DXMenuItem item = sender as DXMenuItem;
            XtraMessageBox.Show(item.Caption);
        }
    }

Devexpress DropDownButton 用法

标签:

原文地址:http://blog.csdn.net/zhishiheng/article/details/43275031

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