How to get the visible groupbar items in WF GroupBar?
You can get the visible group bar items in WinForms GroupBar control by using VisibleGroupBarItems property inside the GroupBarItemSelected event. Refer the below code for your reference.
C#
groupBar1.GroupBarItemSelected += GroupBar1_GroupBarItemSelected;
private void GroupBar1_GroupBarItemSelected(object sender, EventArgs e)
{
String mygroup = this.groupBar1.VisibleGroupBarItems[this.groupBar1.SelectedItem].Text;
MessageBox.Show(mygroup);
}
VB
AddHandler groupBar1.GroupBarItemSelected, AddressOf GroupBar1_GroupBarItemSelected Private Sub GroupBar1_GroupBarItemSelected(ByVal sender As Object, ByVal e As EventArgs) Dim mygroup As String = Me.groupBar1.VisibleGroupBarItems(Me.groupBar1.SelectedItem).Text MessageBox.Show(mygroup) End Sub
Output:

Sample: View sample in GitHub.