6.8. A Pocketful of Buttons

There are three primary button controls—conventional click event buttons, radio buttons, and check box buttons—as pictured in Figure 6.13:

Figure 6.13. Buttons, Radio Buttons, and Check Boxes

  1. The Button control. Buttons are used to signal that a particular action should now occur. In Figure 6.13, we provide three buttons: OK, Clear, and Quit. The primary Button event is a user's click. For example,

     protected void button1_Click( object sender, EventArgs e ) { int cnt = 0; // figure out which images were selected for ( int ix = 0; ix < imageSet.Count; ++ix ) if ( imageSet[ ix ] ) { image += imageTitle[ ix ]; cnt++; } ...

Get C# Primer: A Practical Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.