JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Creating Toggle Buttons

You can turn checkboxes or radio buttons into toggle buttons if you set their Appearance property to Button (the other option is Normal). Toggle buttons resemble standard buttons but act like the checkboxes or radio buttons they really are. When you click a checkbox button, for example, it stays clicked until you click it again.

You can see three radio buttons that have been made into toggle buttons in Figure 6.14.

Figure 6.14: Creating toggle buttons.

Also, in the ToggleButtons example on the CD-ROM, you can click the "Create toggle buttons" button to change the appearance of radio buttons at run time. Here's the code that does the trick:

Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click
    RadioButton1.Appearance = Appearance.Button
    RadioButton2.Appearance = Appearance.Button
    RadioButton3.Appearance = Appearance.Button
End Sub
Previous Section Next Section

JavaScript Editor Free JavaScript Editor     JavaScript Editor