Checkbox in RadCommandBar?

2 posts, 1 answers
  1. Hannes
    Hannes avatar
    8 posts
    Member since:
    Oct 2006

    Posted 21 Feb 2011 Link to this post

    Can you add a checkbox in a RadCommandBar ? It was possible in RadToolStrip.
  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 21 Feb 2011 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top