![]() |
Dialog Boxes |
|
Description |
|
A dialog box is a form defined with particular properties. Like a form, a dialog box is referred to as a container. Like a form, a dialog box is mostly used to host child controls, insuring the role of dialog between the user and the machine. Here is an example of a dialog box: |
|
A dialog box has the following characteristics:
To create a dialog box, you start with a form, which you can get by creating a Windows Application or deriving a class from Form. Here is an example: using System;
using System.Drawing;
using System.Windows.Forms;
public class Exercise : System.Windows.Forms.Form
{
public Exercise()
{
InitializeComponent();
}
private void InitializeComponent()
{
Text = "Domain Configuration";
Width = 320;
Height = 150;
Location = new Point(140, 100);
StartPosition = FormStartPosition.CenterScreen;
}
}
public class Program
{
static int Main()
{
System.Windows.Forms.Application.Run(new Exercise());
return 0;
}
}
This would produce:
|
|
|
||
| Home | Copyright © 2007 FunctionX, Inc. | Next |
|
|
||