.NET MessageBox Control Introduction This Control , as the name implies, is meant for Displaying messages in your Web Pages. Though it is a simple Web Control, I hope that this can be a good and simple introduction to Custom Controls.
How it is implemented?
How to Use the Control?
The Usage of this control is simple and neat. All you have to do is
- compile your control project.
- open your website and right click anywhere in the toolbox and click choose items and browse for the Control DLL.
- Your Control will get added to the ToolBox
- Drop an instance of it to your page , set the Properties like Heading , Message etc and then set the Visible property to true. By default the Visible property is false .
- The Images folder should contain error.gif,information.gif,warning.gif,close.gif Images.
From the Code Behind Page,
this.MessageBox1.Message = "This is a Message";
this.MessageBox1.MessageBoxMode = MessageBoxMode.Error;
this.MessageBox.Visible = true;
Heading : Heading for the Message Box
Message :Message to be displayed
MessageBoxMode: The Type of the Message. The allowed values are, Information, Error, Warning
Color: The ForeColor
BackColor: The Background color for the Message Display Area.
HeadingForeColor: The Foreground color of the Heading Area
HeadingBackColor: The Background color of the Heading Area
AutoHide: A Boolean property indicating whether the MessageBox has to be autohided after a specific interval
AutoHideInterval: The interval for the AutoHide Property.
DropShadow: Boolean Property to specify whether to Drop a Shadow for the MessageBox.
ShadowColor: The color of the Shadow.
ShowButtons: Show the OK and MoreInfo Buttons.
IsModal: Specify whether the window is a modal window.
ImageFolder: Specify the Image Folder.
Position: By this Property , you can specify the position where the message box to be displayed.
For the Appropriate behaviour of this control, The Document type of the Page should be
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
I know that this is not a great control, but I feel that it may help some of you guys to get an idea over the Cusom Controls. Please do post your comments and I appreciate if you can provide any tips or suggestions to improve this control.