JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Adding Buttons to a Toolbar at Run Time

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.

Click To expand
Figure 10.19: Adding buttons to a toolbar at run time.
Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor