![]() ![]() | ||
As you might expect, you can add buttons to a toolbar at run time. To do that, just click the "Add button" button in the ToolBars example on the CD-ROM; here's how that program adds a new button to the toolbar:
Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim ToolBarButton As New ToolBarButton("New Button") ToolBar1.Buttons.Add(ToolBarButton) End Sub
You can see the results in Figure 10.19, where I've added six new buttons to the toolbar.
![]() ![]() | ||