Version

Show(String,String,MessageBoxButtons,MessageBoxIcon,MessageBoxDefaultButton,String,HelpNavigator,Object) Method

Displays an UltraMessageBox
Syntax
'Declaration
 
Public Overloads Shared Function Show( _
   ByVal text As String, _
   ByVal caption As String, _
   ByVal buttons As MessageBoxButtons, _
   ByVal icon As MessageBoxIcon, _
   ByVal defaultButton As MessageBoxDefaultButton, _
   ByVal helpFilePath As String, _
   ByVal helpNavigator As HelpNavigator, _
   ByVal param As Object _
) As DialogResult

Parameters

text
The text to be displayed in the content area of the UltraMessageBox.
caption
The text to be displayed in the caption of the UltraMessageBox
buttons
The buttons to be displayed on the UltraMessageBox
icon
The system icon to be displayed in the content area of the UltraMessageBox
defaultButton
The default active button
helpFilePath
The file path to the help file
helpNavigator
The HelpNavigator which indicates which tab is active on the HTML Help Viewer
param
The additional parameter used in conjunction with the HelpNavigator

Return Value

Returns the DialogResult of the shown UltraMessageBox
Example
The following code demonstrates using the Show() method.

Private Sub DisplayMessage(ByVal owner As IWin32Window, ByVal message As String, ByVal caption As String, ByVal buttons As MessageBoxButtons, ByVal icon As MessageBoxIcon, ByVal defaultButton As MessageBoxDefaultButton, _ 
ByVal helpFilePath As String) 
    ' Set the HelpNavigator so the Help button appears on the UltraMessageBox 
    Dim navigator As HelpNavigator = HelpNavigator.Find 
    Dim additionalParam As Object = "Basic" 
    
    ' If the owner is not set or the owner if the current form and it is a MDI Child, 
    ' use the overload with the IWin32Window owner 
    If owner IsNot Nothing Then 
        Dim ownerForm As Form = TryCast(Form.FromHandle(owner.Handle), Form) 
        If ownerForm IsNot Nothing AndAlso ownerForm.IsMdiChild = True Then 
            UltraMessageBoxManager.Show(message, caption, buttons, icon, defaultButton, helpFilePath, _ 
            navigator, additionalParam) 
        Else 
            UltraMessageBoxManager.Show(owner, message, caption, buttons, icon, defaultButton, _ 
            helpFilePath, navigator, additionalParam) 
        End If 
        Exit Sub 
    End If 
    
    UltraMessageBoxManager.Show(message, caption, buttons, icon, defaultButton, helpFilePath, _ 
    navigator, additionalParam) 
End Sub
private void DisplayMessage(IWin32Window owner, string message, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, string helpFilePath)
{
    // Set the HelpNavigator so the Help button appears on the UltraMessageBox
    HelpNavigator navigator = HelpNavigator.Find;
    object additionalParam = "Basic";

    // If the owner is not set or the owner if the current form and it is a MDI Child,
    // use the overload with the IWin32Window owner
    if (owner != null)
    {
        Form ownerForm = Form.FromHandle(owner.Handle) as Form;
        if (ownerForm != null &&
            ownerForm.IsMdiChild == true)
            UltraMessageBoxManager.Show(message, caption, buttons, icon, defaultButton, helpFilePath, navigator, additionalParam);
        else
            UltraMessageBoxManager.Show(owner, message, caption, buttons, icon, defaultButton, helpFilePath, navigator, additionalParam);
        return;
    }

    UltraMessageBoxManager.Show(message, caption, buttons, icon, defaultButton, helpFilePath, navigator, additionalParam);
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also