O'Reilly logo

C# Primer: A Practical Approach by Stanley B. Lippman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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++; } ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required