The Button panel is simply a panel on the WinStatusBar™ that displays a standard command button.
Add an UltraStatusBar to your Windows Form.
In the Property Pages scroll down to the Panels property. Click the ellipsis to bring up the Panels Collection.
Click the "Add" button. This will add a new panel.
Scroll the properties until you come to the Style property. Set the style property equal to "Button".
Set the Text property to the text you want displayed on the button.
Click OK to close the window and you will see your panel added to the status bar.
In Visual Basic:
Imports Infragistics.Win.UltraWinStatusBar ... Private Sub Set_the_Panel_Style_to_Button_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load ' Create new panel Dim myPanel As New UltraStatusPanel() ' Set the style for the panel myPanel.Style = PanelStyle.Button ' Set the text for your button/panel myPanel.Text = "Press Me" ' Add the panel to the element Me.UltraStatusBar1.Panels.Add(myPanel) End Sub
In C#:
using Infragistics.Win.UltraWinStatusBar; ... private void Set_the_Panel_Style_to_Button_Load(object sender, EventArgs e) { //create new panel UltraStatusPanel myPanel = new UltraStatusPanel(); //set the style for the panel myPanel.Style = PanelStyle.Button; //set the text for your button/panel myPanel.Text = "Press Me"; //add the panel to the element this.ultraStatusBar1.Panels.Add(myPanel); }
The button fires an event called ButtonClick . There is one parameter passed to the event: e.Panel . This parameter provides a reference to the Panel that holds the button. For example, to get a reference to the panel in the ButtonClick event and print out the text on the panel:
In Visual Basic:
Private Sub UltraStatusBar1_ButtonClick(ByVal sender As Object, _ ByVal e As Infragistics.Win.UltraWinStatusBar.PanelEventArgs) _ Handles UltraStatusBar1.ButtonClick MessageBox.Show(e.Panel.Text.ToString()) End Sub
In C#:
private void ultraStatusBar1_ButtonClick(object sender, PanelEventArgs e) { MessageBox.Show(e.Panel.Text.ToString()); }