Dev控件类似于ComBox的DropDownControl用法

  dropDownButton1.DropDownControl= CreateDXPopupMenu();

 

        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(UserLookAndFeel.Default, "OK");

        }

posted on 2017-10-08 17:28  mol1995  阅读(1201)  评论(0编辑  收藏  举报

导航