简体   繁体   中英

Can't find WindowsUIButtonsPanel's button events

I got 2 buttons in my WindowsUIButtonPanel, but I couldn't find button click event. I want to create minimize and close buttons.

WindowsUIButtonPanel provides the ButtonClick event that you can use for this purpose. In the e.Button argument you will get the clicked button.

You can use either WindowsUIButton.Click

WindowsUIButton button1 = windowsUIButtonPanel1.Buttons[1] as WindowsUIButton;
button1.Click += button1_Click;
...
void button1_Click(object sender, EventArgs e) {

}

or WindowsUIButtonPanel.ButtonClick events:

void windowsUIButtonPanel1_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) {
    if(e.Button == windowsUIButtonPanel1.Buttons[0]) { 
        // do something
    }
}

PS The WindowsUIButtonPanel.ButtonClick event is fired for regular buttons only (buttons with the Style property set to PushButton ) and never occurs for check buttons. These raise the ButtonChecked and ButtonUnchecked events instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM