AlertPopup
AlertPopup .NET control class.
public sealed class AlertPopup : Form
Inherits from / implements: Form
Remarks
This is a specialized control that will display alert pop-up windows styled like the popular MSN Instant messenger and Microsoft Outlook 2003 message pop-up windows.
Members at a glance
AlertPopup | Initializes a new instance of AlertPopup .NET control. |
AlertBodyText | Gets or sets the message/body text for the pop-up window. |
AlertNormalBodyTextColor | Gets or sets the foreground color for the message/body text of the pop-up window, when it is in normal mode (i.e. when the message/body text is not in "mouse hover" mode). |
AlertNormalBodyTextFont | Gets or sets the font for the message/body text of the pop-up window, when it is in normal mode (i.e. when the message/body text is not in "mouse hover" mode). |
AlertNormalTitleColor | Gets or sets the foreground color for the title text of the pop-up window,when it is in normal mode (i.e. when the title text is not in mouse hover mode). |
AlertNormalTitleFont | Gets or sets the font for the title text of the pop-up window, when it is in normal mode (i.e. when the title text is not in mouse hover mode). |
AlertOnHoverBodyTextColor | Gets or sets the foreground color for the message/body text of the pop-up window, when it is in "mouse hover" mode. |
AlertOnHoverBodyTextFont | Gets or sets the font for the message/body text of the pop-up window, when it is in "mouse hover" mode. |
AlertOnHoverTitleColor | Gets or sets the foreground color for the title text of the pop-up window,when it is in "mouse hover" mode. |
AlertOnHoverTitleFont | Gets or sets the font for the title text of the pop-up window, when it is in "mouse hover" mode. |
AlertPopupCustomLocation | Gets or sets a custom location of your choice, to display the alert pop-up window. |
AlertPopupIsShownAgainWhenMousePointerIsOver | Gets or sets whether to re-show the pop-up window when the mouse pointer is over the message/body text, when the pop-up window is closing/hiding. |
AlertPopupIsShownWhenMouseIsOver | Gets or sets whether to continue to show the pop-up window when the mouse pointer is over the message/body text, even if the timer interval for displaying the pop-up has elapsed. |
AlertPopupStyle | Gets or sets the pop-up window style. |
AlertTextSelectionRectangleColor | Gets or sets the color for the selection rectangle around the body text. |
AlertTitleText | Gets or sets the title text for the pop-up window. |
AllowUserToDragDropPopupWindow | Gets or sets whether to allow the user to drag-and-drop (or manually relocate) the alert pop-up window. |
CanClickAlertText | Gets or sets whether the pop-up message/body text can be clicked. |
CanClickExitButton | Gets or sets whether the pop-up exit button can be clicked. |
CanClickTitle | Gets or sets whether the pop-up title text can be clicked. |
ColorToUseForFillingContextMenuDropDownChevronRectangleWithSingleColor | Gets or sets the single color to be used to fill the drop-down chevron menu button rectangle. |
ContextMenuDropDownChevronColor | Gets or sets the gradient orientation angle to be used to draw the gradient colors when drawing the drop-down chevron menu button (for the context menu) |
ContextMenuDropDownChevronRectangleBorderColor | Gets or sets the gradient orientation angle to be used to draw the gradient colors when drawing the drop-down chevron menu button (for the context menu) |
ControlDisappearingStyle | Gets or sets the pop-up window's "hiding" style. |
CustomAlertPopupWindowImage | Gets or sets a custom bitmap image to be used for rendering the background of the pop-up window (rather than to use the built-in styles/colors). |
CustomAlertPopupWindowImageCanBeClicked | Gets or sets whether the CustomAlertPopupWindowImage can be clicked or not (if one is currently set). |
CustomAlertTextArea | Gets or sets the custom drawing rectangle for the alert text (i.e. pop-up alert's body text). |
CustomExitIcon | Gets or sets a custom Icon for the exit image within the pop-up window. |
CustomTitleIcon | Gets or sets a custom Image for the title image to be placed in the left hand corner of the pop-up window. |
CustomTitleIconAlignment | Gets or sets the custom alignment for the contorl's title icon/image. |
CustomTitleIconLocation | Gets or sets the custom location for the control's title icon. |
CustomTitleTextArea | Gets or sets the custom drawing rectangle for the title text. |
CustomUserWindowPaintSize | Gets or sets the size of the alert pop-up window, when having the control's property EnableCustomUserPaint to true. |
DisplayExitButton | Gets or sets whether to display an exit button in the right hand corner location of the pop-up window. |
DrawUsingColorType | Gets or sets the custom color type to be used (i.e. either a specific color or a gradient set of colors) for drawing the pop-up window's background. |
DrawUsingCustomColors | Gets or sets whether to draw the pop-up window's background using custom specified colors or to use the default built-in XP theme rendering. |
EnableCustomUserPaint | Gets or sets whether the custom user paint is switched on or off. |
EndColor | Gets or sets the end color value for gradient drawing. |
EndColorToUseForFillingContextMenuDropDownChevronRectangleWithGradientColors | Gets or sets the end color to be used to draw the gradient colors when drawing the drop-down chevron menu button rectangle. |
FillContextMenuDropDownChevronRectangleWithGradientColors | Gets or sets the whether to use gradient colors when filling the drop-down chevron menu button rectangle. |
GradientOrientationAngle | Gets or sets the Gradient orientation angle for drawing the control's background when the DrawUsingCustomColors is set to true and DrawUsingColorType is set to CustomColorType.GradientColors enum value. |
GradientOrientationAngleToUseForFillingDropDownChevronRectangle | Gets or sets the gradient orientation angle to be used to draw the gradient colors when drawing the drop-down chevron menu button (for the context menu) |
IsMouseCurrentlyDown | Gets the value indicating whether the mouse is currently pressed down in the surface of hte alert popup window. |
Opacity | A thread-safe version of setting opacity. Typically, this property is not intended to be used directly by external applications. |
PlaySoundWhenPopupIsDisplayed | Gets or sets whether to play a sound when the pop-up window is displayed. |
PopupAlertThemeColor | Gets or sets the Windows XP theme to emulate for drawing the pop-up window's background. |
ShouldPerformAdvancedCleanupUponHide | Gets or sets to specify whether to perform some advanced memory cleanup avtivities upon hiding the popup instance. |
ShowTextAreaRectangle | Gets or sets whether to display the selection rectangle around the message/body text. |
SoundPlayBackFile | Gets or sets the sound source file (complete path). Only ".wav" files are supported in this version. |
SpecificColor | Gets or sets the specific color value to be used to draw the pop-up window's background. |
StartColor | Gets or sets the start color value for gradient drawing. |
StartColorToUseForFillingContextMenuDropDownChevronRectangleWithGradientColors | Gets or sets the start color to be used to draw the gradient colors when drawing the drop-down chevron menu button rectangle. |
StretchTitleIconToCoverTheEntireControlArea | Gets or sets whether the title icon (refer to CustomTitleIcon), should be stretched across the control's display area. |
UseCustomAlertPopupWindowImage | Gets or sets whether to use the CustomAlertPopupWindowImage as the pop-up window's background image, rather than the built-in styles/colors. |
CleanUpUponContextMenuItemClicked | This method performs internal drawing clean-up once a menu item from the set ContextMenu is clicked by the user. |
Hide | Hides the alert pop-up window. |
KeepShowingUntilHiddenDeterministically | Use this method to keep the alert pop-up window shown until you want to hide it. |
OnClick | Please refer to the base class documentation. |
OnMouseDown | Please refer to the base class documentation. |
OnMouseEnter | Please refer to the base class documentation. |
OnMouseLeave | Please refer to the base class documentation. |
OnMouseMove | Please refer to the base class documentation. |
OnMouseUp | Please refer to the base class documentation. |
OnPaint | Refer to OnPaint event documentation. |
OnPaintBackground | Please refer to the base class documentation. |
Show | A simple new implementation of the base Show method to simply display an alert pop-up with default settings (and no message/title text). |
Show | A simple overloaded method to display an alert pop-up with default settings. |
Show | A simple overloaded method to display an alert pop-up which will use the built-in display location. |
Show | Shows the alert pop up window. |
AboutToPlaySound | This event is raised when the pop-up is about to play a sound. |
AboutToPopup | This event is raised when the pop-up is about to be displayed. |
ContextMenuShown | This event is raised when the user clicks on the drop-down menu button (first button from the top right corner of the control's display area). |
PopupCustomImageClicked | This event is raised when the pop-up is set with a CustomAlertPopupWindowImage and the UseCustomAlertPopupWindowImage is set to true, and the user has clicked anywhere in the pop-up alert window. |
PopupExitButtonClicked | This event is raised when the pop-up exit button image is clicked. |
PopupMessageTextClicked | This event is raised when the pop-up message/body text is clicked. |
PopupTitleTextClicked | This event is raised when the pop-up title text is clicked. |
Constructors
AlertPopup
Initializes a new instance of AlertPopup .NET control.
Properties
AlertBodyText
Gets or sets the message/body text for the pop-up window.
AlertNormalBodyTextColor
Gets or sets the foreground color for the message/body text of the pop-up window, when it is in normal mode (i.e. when the message/body text is not in "mouse hover" mode).
AlertNormalBodyTextFont
Gets or sets the font for the message/body text of the pop-up window, when it is in normal mode (i.e. when the message/body text is not in "mouse hover" mode).
AlertNormalTitleColor
Gets or sets the foreground color for the title text of the pop-up window,when it is in normal mode (i.e. when the title text is not in mouse hover mode).
AlertNormalTitleFont
Gets or sets the font for the title text of the pop-up window, when it is in normal mode (i.e. when the title text is not in mouse hover mode).
AlertOnHoverBodyTextColor
Gets or sets the foreground color for the message/body text of the pop-up window, when it is in "mouse hover" mode.
AlertOnHoverBodyTextFont
Gets or sets the font for the message/body text of the pop-up window, when it is in "mouse hover" mode.
AlertOnHoverTitleColor
Gets or sets the foreground color for the title text of the pop-up window,when it is in "mouse hover" mode.
AlertOnHoverTitleFont
Gets or sets the font for the title text of the pop-up window, when it is in "mouse hover" mode.
AlertPopupCustomLocation
Gets or sets a custom location of your choice, to display the alert pop-up window.
AlertPopupIsShownAgainWhenMousePointerIsOver
Gets or sets whether to re-show the pop-up window when the mouse pointer is over the message/body text, when the pop-up window is closing/hiding.
AlertPopupIsShownWhenMouseIsOver
Gets or sets whether to continue to show the pop-up window when the mouse pointer is over the message/body text, even if the timer interval for displaying the pop-up has elapsed.
AlertPopupStyle
Gets or sets the pop-up window style.
AlertPopupStyle enum for all supported styles.The default value is Outlook2003 style.
AlertTextSelectionRectangleColor
Gets or sets the color for the selection rectangle around the body text.
Highlight if the ShowTextAreaRectangle property is set to true.AlertTitleText
Gets or sets the title text for the pop-up window.
AllowUserToDragDropPopupWindow
Gets or sets whether to allow the user to drag-and-drop (or manually relocate) the alert pop-up window.
CanClickAlertText
Gets or sets whether the pop-up message/body text can be clicked.
CanClickExitButton
Gets or sets whether the pop-up exit button can be clicked.
CanClickTitle
Gets or sets whether the pop-up title text can be clicked.
ControlDisappearingStyle
Gets or sets the pop-up window's "hiding" style.
DisappearingStyle for the list of various supported styles.CustomAlertPopupWindowImage
Gets or sets a custom bitmap image to be used for rendering the background of the pop-up window (rather than to use the built-in styles/colors).
UseCustomAlertPopupWindowImage property has been set to true, not otherwise.CustomAlertPopupWindowImageCanBeClicked
Gets or sets whether the CustomAlertPopupWindowImage can be clicked or not (if one is currently set).
CustomAlertTextArea
Gets or sets the custom drawing rectangle for the alert text (i.e. pop-up alert's body text).
CustomExitIcon
Gets or sets a custom Icon for the exit image within the pop-up window.
CustomTitleIcon
Gets or sets a custom Image for the title image to be placed in the left hand corner of the pop-up window.
CustomTitleIconAlignment
Gets or sets the custom alignment for the contorl's title icon/image.
CustomTitleIconLocation
Gets or sets the custom location for the control's title icon.
CustomTitleIconAlignment property to set the control's custom location. The location is in logical (96 DPI) units and is scaled to the display; setting CustomTitleIconAlignment afterwards returns the icon to the alignment. Use this property if you want precise control over the location of the title icon.
CustomTitleTextArea
Gets or sets the custom drawing rectangle for the title text.
CustomUserWindowPaintSize
Gets or sets the size of the alert pop-up window, when having the control's property EnableCustomUserPaint to true.
If you want to paint the alert pop-up window yourself, just set the control's EnableCustomUserPaint property to true, and subscribe to the control's Paint event and write your paint code. Note that you can also setup the size of the alert pop-up window, to draw into.
Example:
bAlertPopup.EnableCustomUserPaint = true; bAlertPopup.CustomUserWindowPaintSize = new Size(500, 380); bAlertPopup.Paint += new PaintEventHandler(MyCustomPaintRoutine); The features list does not stop here.
Now, after setting up the above, you can also start to add your custom controls into the alert pop-up window, by simply preparing the layout of your other windows Forms controls, and add these to the alert popup's "Controls" collection. There you go, your own custom form type window is ready to pop-up as an alert pop-up window.
For example:
Panel panel = new Panel(); TreeView treeview = new TreeView(); // Now prepare your treeview control. Now prepare some more controls, say, a textBox control. TextBox textBox = new TextBox(); // Now prepare your textBox control
Create and layout some more Windows Forms / custom controls
Now add these controls to AlertPopup control's control collection...
bAlertPopup.Controls.AddRange(new Control[] { treeview, textBox /*, your other control instances*/ }); That is all to it!
The AlertPopup will now host and display your controls collection in the way you have laid it out on the window surface and display the configured alert pop-up.
DisplayExitButton
Gets or sets whether to display an exit button in the right hand corner location of the pop-up window.
DrawUsingColorType
Gets or sets the custom color type to be used (i.e. either a specific color or a gradient set of colors) for drawing the pop-up window's background.
DrawUsingCustomColors and also the enum CustomColorType.DrawUsingCustomColors
Gets or sets whether to draw the pop-up window's background using custom specified colors or to use the default built-in XP theme rendering.
EnableCustomUserPaint
Gets or sets whether the custom user paint is switched on or off.
Paint event and attach your custom painting code. Note: Once custom painting is enabled, none of the default properties will be enabled excepting for the AlertPopupStyle property whose value will be used to determine the control's surface size. Also use the other property
CustomUserWindowPaintSize, if you want to setup a custom size for the alert pop-up window when you want to own drawing the control's surface and child objects.EndColor
Gets or sets the end color value for gradient drawing.
DrawUsingCustomColors is set to true and DrawUsingColorType property is set to CustomColorType.GradientColors enum value.GradientOrientationAngle
Gets or sets the Gradient orientation angle for drawing the control's background when the DrawUsingCustomColors is set to true and DrawUsingColorType is set to CustomColorType.GradientColors enum value.
GradientOrientationAngleToUseForFillingDropDownChevronRectangle
Gets or sets the gradient orientation angle to be used to draw the gradient colors when drawing the drop-down chevron menu button (for the context menu)
ContextMenu property is set to a valid ContextMenu object and the property FillContextMenuDropDownChevronRectangleWithGradientColors has been set to true.IsMouseCurrentlyDown
Gets the value indicating whether the mouse is currently pressed down in the surface of hte alert popup window.
Opacity
A thread-safe version of setting opacity. Typically, this property is not intended to be used directly by external applications.
PlaySoundWhenPopupIsDisplayed
Gets or sets whether to play a sound when the pop-up window is displayed.
PopupAlertThemeColor
Gets or sets the Windows XP theme to emulate for drawing the pop-up window's background.
AlertPopupThemeColor enumeration for the list of supported Windows XP theme emulations.ShouldPerformAdvancedCleanupUponHide
Gets or sets to specify whether to perform some advanced memory cleanup avtivities upon hiding the popup instance.
ShowTextAreaRectangle
Gets or sets whether to display the selection rectangle around the message/body text.
SoundPlayBackFile
Gets or sets the sound source file (complete path). Only ".wav" files are supported in this version.
SpecificColor
Gets or sets the specific color value to be used to draw the pop-up window's background.
DrawUsingColorType property is set to SpecificColor value.StartColor
Gets or sets the start color value for gradient drawing.
DrawUsingCustomColors is set to true and DrawUsingColorType property is set to CustomColorType.GradientColors enum value.StretchTitleIconToCoverTheEntireControlArea
Gets or sets whether the title icon (refer to CustomTitleIcon), should be stretched across the control's display area.
CustomTitleIconAlignment will not have any effect.UseCustomAlertPopupWindowImage
Gets or sets whether to use the CustomAlertPopupWindowImage as the pop-up window's background image, rather than the built-in styles/colors.
Methods
Hide
Hides the alert pop-up window.
OnClick
Please refer to the base class documentation.
OnMouseDown
Please refer to the base class documentation.
OnMouseEnter
Please refer to the base class documentation.
OnMouseLeave
Please refer to the base class documentation.
OnMouseMove
Please refer to the base class documentation.
OnMouseUp
Please refer to the base class documentation.
OnPaint
Refer to OnPaint event documentation.
- pe
OnPaintBackground
Please refer to the base class documentation.
Show
A simple new implementation of the base Show method to simply display an alert pop-up with default settings (and no message/title text).
An empty title text.
An empty body text.
An animation duration of 500 milliseconds.
A visibility duration of 3000 milliseconds.
An animation hiding duration of 500 milliseconds.
If you have not set up the
AlertPopupCustomLocation property, then the pop-up display location will be set to (0,0) [bottom-right corner], otherwise whatever you have set up as the location in AlertPopupCustomLocation property. Show
A simple overloaded method to display an alert pop-up with default settings.
- theAlertTitle
- The title text of the alert pop-up
- theBodyText
- The body text of the alert pop-up
An empty title text.
An empty body text.
An animation duration of 500 milliseconds.
A visibility duration of 3000 milliseconds.
An animation hiding duration of 500 milliseconds.
If you have not set up the
AlertPopupCustomLocation property, then the pop-up display location will be set to (0,0) [bottom-right corner], otherwise whatever you have set up as the location in AlertPopupCustomLocation property. Show
A simple overloaded method to display an alert pop-up which will use the built-in display location.
- theAlertTitle
- The title text of the alert pop-up
- theBodyText
- The body text of the alert pop-up
- theAnimationDuration
- The amount of time to show the animation (milliseconds)
- theVisibilityDuration
- The amount of time to display the visible state of the pop-up before hiding it (milliseconds)
- theAnimationHidingDuration
- The amount of time to do the hiding animation (milliseconds)
When using this overloaded method, the following defaults will apply:
If you have not set up the
AlertPopupCustomLocation property, then the pop-up display location will be set to (0,0) [bottom-right corner], otherwise whatever you have set up as the location in AlertPopupCustomLocation property. Show
Shows the alert pop up window.
- theAlertTitle
- The title text of the alert pop-up
- theBodyText
- The body text of the alert pop-up
- theAnimationDuration
- The amount of time to show the animation (milliseconds)
- theVisibilityDuration
- The amount of time to display the visible state of the pop-up before hiding it (milliseconds)
- theAnimationHidingDuration
- The amount of time to do the hiding animation (milliseconds)
- customLocationToShowThePopup
- The custom location to show the alert pop-up window. Set this to new Point(0,0) if you want to let the control use the default location. Otherwise set this parameter to a valid point in the screen.
Events
AboutToPlaySound
This event is raised when the pop-up is about to play a sound.
AboutToPopup
This event is raised when the pop-up is about to be displayed.
PopupCustomImageClicked
This event is raised when the pop-up is set with a CustomAlertPopupWindowImage and the UseCustomAlertPopupWindowImage is set to true, and the user has clicked anywhere in the pop-up alert window.
PopupExitButtonClicked
This event is raised when the pop-up exit button image is clicked.
PopupMessageTextClicked
This event is raised when the pop-up message/body text is clicked.
PopupTitleTextClicked
This event is raised when the pop-up title text is clicked.