ICreate.Controls.Bars Send comments on this topic.
CheckGroupIdentifier Property
See Also  Example
ICreate.Controls.Bars Namespace > ButtonBarButton Class : CheckGroupIdentifier Property






Gets or sets the identifier of the check group to which the ButtonBarButton belongs.

Syntax

Visual Basic (Declaration) 
Public Property CheckGroupIdentifier As String
Visual Basic (Usage)Copy Code
Dim instance As ButtonBarButton
Dim value As String
 
instance.CheckGroupIdentifier = value
 
value = instance.CheckGroupIdentifier
C# 
public string CheckGroupIdentifier {get; set;}
Delphi 
public read-write property CheckGroupIdentifier: String; 
JScript 
public function get,set CheckGroupIdentifier : String
Managed Extensions for C++ 
public: __property string* get_CheckGroupIdentifier();
public: __property void set_CheckGroupIdentifier( 
   string* value
);
C++/CLI 
public:
property String^ CheckGroupIdentifier {
   String^ get();
   void set (String^ value);
}

Return Value

A System.String value this property specifies the identifier of the check group to which the ButtonBarButton belongs. All ButtonBarButton instances with the same CheckGroupIdentifier belong to the same check group. The default value for CheckGroupIdentifier is the empty string.

Example

The example below shows how to use the CheckGroupIdentifier to define a ButtonBarButton check group. The example creates a ButtonBar docked on the left of the Form. The ButtonBar has three buttons: Input; Process and Output. Each ButtonBarButton has a Panel assigned to its Control property. The Panel is shown when the ButtonBarButton is clicked. All Panel controls assigned to the other ButtonBarButtons are hidden.
C#Copy Code
using System; 
using System.Drawing; 
using System.Windows.Forms; 
using ICreate.Controls.Bars; 
 
namespace ExamplesButtonBarButtonCSharp 

    public partial class CheckGroupIndentifierExample : Form 
    { 
        public CheckGroupIndentifierExample() 
        { 
            InitializeComponent(); 
 
            string controlCheckGroupIdentifier = "ControlCheckGroup"; 
            ButtonBar buttonBar = new ButtonBar(); 
            buttonBar.Animate = true; 
            buttonBar.Dock = DockStyle.Left; 
            buttonBar.Style = ButtonBarStyle.Office2007; 
 
            ButtonBarButton inputButton = new ButtonBarButton( "Input", Image.FromFile("input.gif" )); 
            ButtonBarButton processButton = new ButtonBarButton( "Process", Image.FromFile("process.gif" )); 
            ButtonBarButton outputButton = new ButtonBarButton( "Output", Image.FromFile("output.gif" )); 
 
            inputButton.TextImageRelation = TextImageRelation.ImageAboveText; 
            processButton.TextImageRelation = TextImageRelation.ImageAboveText; 
            outputButton.TextImageRelation = TextImageRelation.ImageAboveText; 
 
            inputButton.CheckGroupIdentifier = controlCheckGroupIdentifier; 
            processButton.CheckGroupIdentifier = controlCheckGroupIdentifier; 
            outputButton.CheckGroupIdentifier = controlCheckGroupIdentifier; 
 
            inputButton.CheckOnClick = true; 
            processButton.CheckOnClick = true; 
            outputButton.CheckOnClick = true; 
 
            Panel inputPanel = new Panel(); 
            Panel processPanel = new Panel(); 
            Panel outputPanel = new Panel(); 
 
            inputPanel.BackColor = Color.White; 
            inputPanel.Dock = DockStyle.Fill; 
 
            processPanel.BackColor = Color.Cyan; 
            processPanel.Dock = DockStyle.Fill; 
 
            outputPanel.BackColor = Color.LightGray; 
            outputPanel.Dock = DockStyle.Fill; 
 
            inputButton.Control = inputPanel; 
            processButton.Control = processPanel; 
            outputButton.Control = outputPanel; 
 
            buttonBar.Items.Add(inputButton); 
            buttonBar.Items.Add(processButton); 
            buttonBar.Items.Add(outputButton); 
 
            Controls.Add(buttonBar); 
            Controls.Add(inputPanel); 
            Controls.Add(processPanel); 
            Controls.Add(outputPanel); 
        } 
    } 

Visual BasicCopy Code
Imports ICreate.Controls.Bars

Public Class CheckGroupIdentifierExample

    Public Sub New()
        InitializeComponent()

        Dim controlCheckGroupIdentifier As String = "ControlCheckGroup"
        Dim buttonBar As ButtonBar = New ButtonBar
        buttonBar.Animate = True
        buttonBar.Dock = DockStyle.Left
        buttonBar.Style = ButtonBarStyle.Office2007

        Dim inputButton As ButtonBarButton = New ButtonBarButton("Input", Image.FromFile("input.gif"))
        Dim processButton As ButtonBarButton = New ButtonBarButton("Process", Image.FromFile("process.gif"))
        Dim outputButton As ButtonBarButton = New ButtonBarButton("Output", Image.FromFile("output.gif"))

        inputButton.TextImageRelation = TextImageRelation.ImageAboveText
        processButton.TextImageRelation = TextImageRelation.ImageAboveText
        outputButton.TextImageRelation = TextImageRelation.ImageAboveText

        inputButton.CheckGroupIdentifier = controlCheckGroupIdentifier
        processButton.CheckGroupIdentifier = controlCheckGroupIdentifier
        outputButton.CheckGroupIdentifier = controlCheckGroupIdentifier

        inputButton.CheckOnClick = True
        processButton.CheckOnClick = True
        outputButton.CheckOnClick = True

        Dim inputPanel As Panel = New Panel
        Dim processPanel As Panel = New Panel
        Dim outputPanel As Panel = New Panel

        inputPanel.BackColor = Color.White
        inputPanel.Dock = DockStyle.Fill

        processPanel.BackColor = Color.Cyan
        processPanel.Dock = DockStyle.Fill

        outputPanel.BackColor = Color.LightGray
        outputPanel.Dock = DockStyle.Fill

        inputButton.Control = inputPanel
        processButton.Control = processPanel
        outputButton.Control = outputPanel

        buttonBar.Items.Add(inputButton)
        buttonBar.Items.Add(processButton)
        buttonBar.Items.Add(outputButton)

        Controls.Add(buttonBar)
        Controls.Add(inputPanel)
        Controls.Add(processPanel)
        Controls.Add(outputPanel)
    End Sub

End Class

Remarks

The CheckOnClick property determines if the Checked property of the ButtonBarButton is automatically toggled when the ButtonBarButton is clicked. Only one ButtonBarButton in a check group may be Checked at any time.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also