バージョン 24.2 (最新)

Show(IWin32Window,String,String,MessageBoxButtons,MessageBoxIcon,MessageBoxDefaultButton,String,String) メソッド

UltraMessageBox を表示します。
シンタックス

パラメータ

owner
ダイアログのオーナーになる IWin32Window。
text
UltraMessageBox のコンテンツ領域に表示するテキスト。
caption
UltraMessageBox のキャプションに表示するテキスト。
buttons
UltraMessageBox に表示するボタン。
icon
UltraMessageBox のコンテンツ領域に表示するシステム アイコン。
defaultButton
デフォルトのアクティブ ボタン。
helpFilePath
ヘルプ ファイルへのパス。
keyword
ヘルプが表示されるキーワード。

戻り値の型

表示される UltraMessageBox の DialogResult を返します。
使用例
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, ByVal keyWord As String) 
    ' Set the HelpNavigator so the Help button appears on the UltraMessageBox 
    Dim navigator As HelpNavigator = HelpNavigator.KeywordIndex 
    
    ' 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, keyWord) 
        Else 
            UltraMessageBoxManager.Show(owner, message, caption, buttons, icon, defaultButton, _ 
            helpFilePath, navigator, keyWord) 
        End If 
        Exit Sub 
    End If 
    
    UltraMessageBoxManager.Show(message, caption, buttons, icon, defaultButton, helpFilePath, _ 
    navigator, keyWord) 
End Sub
'宣言
 
Public Overloads Shared Function Show( _
   ByVal owner As IWin32Window, _
   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 keyword As String _
) As DialogResult
 
private void DisplayMessage(IWin32Window owner, string message, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, string helpFilePath, string keyWord)
{
    // Set the HelpNavigator so the Help button appears on the UltraMessageBox
    HelpNavigator navigator = HelpNavigator.KeywordIndex;

    // 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, keyWord);
        else
            UltraMessageBoxManager.Show(owner, message, caption, buttons, icon, defaultButton, helpFilePath, navigator, keyWord);
        return;
    }

    UltraMessageBoxManager.Show(message, caption, buttons, icon, defaultButton, helpFilePath, navigator, keyWord);
}
'宣言
 
Public Overloads Shared Function Show( _
   ByVal owner As IWin32Window, _
   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 keyword As String _
) As DialogResult
 
参照