Button Caption in Windows Forms Split Button

29 Apr 20211 minute to read

This feature enables you to name your SplitButton as needed.

Adding caption to the SplitButton

You can add a button caption to the SplitButton or set the selected item as the caption.

The following code illustrates how to add a caption for the button:

splitButton1.Text = "Click";
splitButton1.Text = "Click"

Button-Caption_img1

The following code illustrates how to set the selected item from the dropdown as the caption:

private void splitButton1_DropDowItemClicked(object sender, ToolStripItemClickedEventArgs e)
{             
     splitButton1.Text = e.ClickedItem.Text;
}
Private Sub splitButton1_DropDowItemClicked(ByVal sender As Object, ByVal e As ToolStripItemClickedEventArgs)
splitButton1.Text = e.ClickedItem.Text
End Sub

Button-Caption_img2