0

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

DmitryG
  • 17,677
  • 1
  • 30
  • 53
Giray
  • 79
  • 12

2 Answers2

0

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

Gosha_Fighten
  • 3,838
  • 1
  • 20
  • 31
0

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
    }
}

P.S. 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.

DmitryG
  • 17,677
  • 1
  • 30
  • 53