MessageBoxOptions 列挙体とは? わかりやすく解説

MessageBoxOptions 列挙体

MessageBoxオプション指定します

この列挙体には、メンバ値のビットごとの組み合わせ可能にする FlagsAttribute 属性含まれています。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

<FlagsAttribute> _
Public Enumeration MessageBoxOptions
Dim instance As MessageBoxOptions
[FlagsAttribute] 
public enum MessageBoxOptions
[FlagsAttribute] 
public enum class MessageBoxOptions
/** @attribute FlagsAttribute() */ 
public enum MessageBoxOptions
FlagsAttribute 
public enum MessageBoxOptions
メンバメンバ
解説解説
使用例使用例
Private Sub ValidateUserEntry2()


    ' Checks the value of the text.

    If ServerName.Text.Length = 0 Then

        ' Initializes variables to pass to the MessageBox.Show method.

        Dim Message As String
 = "You did not enter a server name. Cancel this operation?"
        Dim Caption As String
 = "No Server Name Specified"
        Dim Buttons As Integer
 = MessageBoxButtons.YesNo

        Dim Result As DialogResult

        'Displays a MessageBox using the Question icon and specifying
 the No button as the default.

        Result = MessageBox.Show(Me, Message, Caption, MessageBoxButtons.YesNo,
 _
            MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign)


        ' Gets the result of the MessageBox display.

        If Result = DialogResult.Yes Then

            ' Closes the parent form.

            Me.Close()

        End If

    End If

End Sub
private void validateUserEntry2()
{

    // Checks the value of the text.

    if(serverName.Text.Length == 0)
    {

        // Initializes the variables to pass to the MessageBox.Show
 method.

        string message = "You did not enter a server name.
 Cancel this operation?";
        string caption = "No Server Name Specified";
        MessageBoxButtons buttons = MessageBoxButtons.YesNo;
        DialogResult result;

        // Displays the MessageBox.

        result = MessageBox.Show(this, message, caption, buttons
,
            MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, 
            MessageBoxOptions.RightAlign);

        if(result == DialogResult.Yes)
        {

            // Closes the parent form.

            this.Close();

        }

    }

}

private:
   void validateUserEntry2()
   {
      // Checks the value of the text.
      if ( serverName->Text->Length == 0 )
      {
         // Initializes the variables to pass to the MessageBox::Show
 method.
         String^ message = "You did not enter a server name. Cancel this
 operation?";
         String^ caption = "No Server Name Specified";
         MessageBoxButtons buttons = MessageBoxButtons::YesNo;
         System::Windows::Forms::DialogResult result;
         
         // Displays the MessageBox.
         result = MessageBox::Show( this, message, caption, buttons,
 MessageBoxIcon::Question, MessageBoxDefaultButton::Button1, MessageBoxOptions::RightAlign
 );
         if ( result == ::DialogResult::Yes )
         {
            // Closes the parent form.
            this->Close();
         }
      }
   }
private void ValidateUserEntry2()
{
    // Checks the value of the text.
    if (serverName.get_Text().get_Length() == 0) {
        // Initializes the variables to pass to the MessageBox.Show
 method.
        String message = "You did not enter a server name. "
            + "Cancel this operation?";
        String caption = "No Server Name Specified";
        MessageBoxButtons buttons = MessageBoxButtons.YesNo;
        DialogResult result;

        // Displays the MessageBox.
        result = MessageBox.Show(this, message, caption, buttons
, 
            MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, 
            MessageBoxOptions.RightAlign);

        if (result.Equals(DialogResult.Yes)) {
            // Closes the parent form.
            this.Close();
        }
    }
} //ValidateUserEntry2
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「MessageBoxOptions 列挙体」の関連用語

MessageBoxOptions 列挙体のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



MessageBoxOptions 列挙体のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS