O'Reilly logo

A Programmer's Guide to .NET by Alexei Fedorov

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

8.4. Dialog boxes

Windows forms can act as dialog boxes that are used to interact with users and retrieve information. To construct our own dialog box we create a new form, and set its FormBorderStyle property to FixedDialog or FixedToolWindow – this automatically removes unnecessary minimize, maximize, and system menu buttons. After this, we place the necessary controls and buttons on the form. Usually, we have Ok, Cancel, or Abort buttons in the dialog box. By associating the DialogResult property of each button with the appropriate DialogResult value, such as Ok, Cancel, and so on, we can specify the resulting action of the dialog box. This allows us to let the calling code know how it was closed.

Dialog boxes can be displayed either modally ...

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