• Adding a Command to the RibbonStatusBar control [Janus UI and Ribbon Controls v3.5 for .NET]

    Create and add a StatusBarPanel to a RibbonStatusBar control.

    The RibbonStatusBar control has two collections were you can add commands, the LeftPanelCommands that represents the commands aligned to the left side of control (painted with a light background) and the RightPanelCommands that has a darker background and are aligned to the right edge of the StatusBar.

    The following code shows how to create and add a SatusBarPanel to the left side of the RibbonStatusBar.

    In C#



    //Create the RibbonStatusBar control

    Janus.Windows.Ribbon.RibbonStatusBar statusBar = new Janus.Windows.Ribbon.RibbonStatusBar();

    statusBar.Height = 22;

    this.Controls.Add(statusBar);



    Janus.Windows.Ribbon.StatusBarPanel panel = new Janus.Windows.Ribbon.StatusBarPanel();

    //Specify that the panel should act as label and cannot be clicked

    panel.PanelBehavior = PanelBehavior.Label;

    panel.Text = "Panel text";



    //Specify that the panel should be resized to fill the empty space in the left side of the StatusBar control.

    panel.AutoSize = StatusBarPanelAutoSize.Spring;



    //Add the panel to the LeftPanelCommands collection of the StatusBar

    statusBar.LeftPanelCommands.Add(panel);



    In VB



    'Create the RibbonStatusBar control

    Dim statusBar As New Janus.Windows.Ribbon.RibbonStatusBar()

    statusBar.Height = 22

    Me.Controls.Add(statusBar)



    Dim panel As New Janus.Windows.Ribbon.StatusBarPanel()

    'Specify that the panel should act as label and cannot be clicked

    panel.PanelBehavior = PanelBehavior.Label

    panel.Text = "Panel text"



    'Specify that the panel should be resized to fill the empty space in the left side of the StatusBar control.

    panel.AutoSize = StatusBarPanelAutoSize.Spring



    'Add the panel to the LeftPanelCommands collection of the StatusBar

    statusBar.LeftPanelCommands.Add(panel)



    The following list shows the types of commands that can be added to a RibbonStatusBar



    ButtonCommand : Represents a button that can be clicked. Use the SizeStyle property of the button to specify if the button should be presented as a large button that occupies the full height of the ribbon or as a small button.



    DropDownCommand : Inherits from ButtonCommand and it also has a Commands collection that is displayed on a menu window after clicking on the button.



    LabelCommand : Represents a label in the ribbon with text and image that cannot be clicked or highlighted



    MdiListCommand : Inherits from DropDownCommand and a command is added to its Commands collection for every MDI child form open in the application.



    CheckBoxCommand : Represents a UICheckBox control in the Ribbon.



    ComboBoxCommand : Represents a UIComboBox control in the Ribbon



    TextBoxCommand : Represents a TextBox control.



    ContainerControlCommand : Use this command type to add a custom Control to the Ribbon. Set the custom control to the Control property of the command and use the ControlWidth property to specify its width.



    ButtonGroup : Represents a group of commands with a border around them



    SeparatorCommand : Represents a separator line in its parent object. When you add a SeparatorCommand to a DropDown use the Title property if you want the command to be represents as a title in the menu window.



    StatusBarPanel : Represent a panel in a panel in RibbonStatusBar. Use the PanelBehavior property to specify whether the panel should act as a button or a label and use the AutoSize property to specify how the panel will be sized.

    Source Of Information : Janus v3.5 Help Files for VS 2008


0 comments:

Leave a Reply