This is a migrated thread and some comments may be shown as answers.

Checkbox in RadCommandBar?

1 Answer 106 Views
CommandBar
This is a migrated thread and some comments may be shown as answers.
Hannes
Top achievements
Rank 1
Hannes asked on 21 Feb 2011, 12:20 PM
Can you add a checkbox in a RadCommandBar ? It was possible in RadToolStrip.

1 Answer, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 21 Feb 2011, 12:31 PM
Hello,

Yes, you can add any sort of RadElement to the RadCommandBar by using a CommandBarHostItem.

For exmaple
Dim host As New CommandBarHostItem()
Dim checkbox As New RadCheckBoxElement()
checkbox.Text = "Im a checkbox"
checkbox.Checked = True
AddHandler checkbox.ToggleStateChanged, AddressOf CheckBox_ToggleStateChanged
host.HostedItem = checkbox
Me.CommandBarStripElement1.Items.Add(host)

Private Sub CheckBox_ToggleStateChanged(ByVal sender As Object, ByVal e As StateChangedEventArgs)
    MessageBox.Show(e.ToggleState.ToString())
End Sub

Hope you find that helps, but let me know if you have any questions
Richard
Tags
CommandBar
Asked by
Hannes
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Share this question
or