CommonDialog.HelpRequest イベントとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CommonDialog.HelpRequest イベントの意味・解説 

CommonDialog.HelpRequest イベント

ユーザーコモン ダイアログ ボックスの [?] ボタンクリックする発生します

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

Dim instance As CommonDialog
Dim handler As EventHandler

AddHandler instance.HelpRequest, handler
/** @event */
public void add_HelpRequest (EventHandler value)

/** @event */
public void remove_HelpRequest (EventHandler
 value)
JScript では、イベント使用できますが、新規に宣言することはできません。
解説解説
使用例使用例

AnyColor プロパティと AllowFullOpen プロパティ設定して ColorDialog オブジェクト初期化する方法次のコード例示しますColorDialog オブジェクトではユーザーカスタム カラー設定することはできません。ただし、基本色セットはすべて表示できます。SolidColorOnly プロパティfalse設定すると、256 色以下のシステム上の色を組み合わせた色を表示できるようになります。またこの例では、ShowHelp プロパティ設定方法と、ダイアログHelpRequest イベント処理方法示します。この例を実行するには、次のコードフォーム貼り付けてフォームコンストラクタまたは Load メソッドInitializeColorDialog メソッド呼び出します。この例では、ボタンClick イベントが、この例で定義されているイベント ハンドラ関連付けられている必要があります

' This method initializes ColorDialog1 to allow any colors, 
' and combination colors on systems with 256 colors or less, 
' but will not allow the user to set custom colors.  The
' dialog will contain the help button.
Private Sub InitializeColorDialog()
    Me.ColorDialog1 = New System.Windows.Forms.ColorDialog
    Me.ColorDialog1.AllowFullOpen = False
    Me.ColorDialog1.AnyColor = True
    Me.ColorDialog1.SolidColorOnly = False
    Me.ColorDialog1.ShowHelp = True
End Sub
  

' This method opens the dialog and checks the DialogResult value. 
' If the result is OK, the text box's background color will be changed
 
' to the user-selected color.
Private Sub Button1_Click(ByVal
 sender As System.Object,  _
    ByVal e As System.EventArgs) Handles
 Button1.Click
    Dim result As DialogResult = ColorDialog1.ShowDialog()
    If (result.Equals(DialogResult.OK)) Then
        TextBox1.BackColor = ColorDialog1.Color
    End If
End Sub
 
  
' This method is called when the HelpRequest event is raised, 
'which occurs when the user clicks the Help button on the ColorDialog
 object.
Private Sub ColorDialog1_HelpRequest(ByVal
 sender As Object, _ 
    ByVal e As System.EventArgs) Handles
 ColorDialog1.HelpRequest

    MessageBox.Show("Please select a color by clicking it."
 _
    & "This will change the BackColor property of the TextBox.")
End Sub
// This method initializes ColorDialog1 to allow any colors, 
// and combination colors on systems with 256 colors or less, 
// but will not allow the user to set custom colors.  The
// dialog will contain the help button.
private void InitializeColorDialog()
{
    this.ColorDialog1 = new System.Windows.Forms.ColorDialog();
    this.ColorDialog1.AllowFullOpen = false;
    this.ColorDialog1.AnyColor = true;
    this.ColorDialog1.SolidColorOnly = false;
    this.ColorDialog1.ShowHelp = true;
    
    // Associate the event-handling method with
    // the HelpRequest event.
    this.ColorDialog1.HelpRequest 
        += new System.EventHandler(ColorDialog1_HelpRequest);
}


// This method opens the dialog and checks the DialogResult value. 
// If the result is OK, the text box's background color will be changed
 
// to the user-selected color.
private void Button1_Click(System.Object sender,
 System.EventArgs e)
{
    DialogResult result = ColorDialog1.ShowDialog();
    if (result.Equals(DialogResult.OK))
    {
        TextBox1.BackColor = ColorDialog1.Color;
    }
}

// This method is called when the HelpRequest event is raised, 
//which occurs when the user clicks the Help button on the ColorDialog
 object.
private void ColorDialog1_HelpRequest(object
 sender, System.EventArgs e)
{

    MessageBox.Show("Please select a color by clicking it. "
       + "This will change the BackColor property of the TextBox.");
}
// This method initializes ColorDialog1 to allow any colors, 
// and combination colors on systems with 256 colors or less, 
// but will not allow the user to set custom colors.  The
// dialog will contain the help button.
void InitializeColorDialog()
{
   this->ColorDialog1 = gcnew System::Windows::Forms::ColorDialog;
   this->ColorDialog1->AllowFullOpen = false;
   this->ColorDialog1->AnyColor = true;
   this->ColorDialog1->SolidColorOnly = false;
   this->ColorDialog1->ShowHelp = true;
   
   // Associate the event-handling method with
   // the HelpRequest event.
   this->ColorDialog1->HelpRequest +=
      gcnew System::EventHandler( this, &Form1::ColorDialog1_HelpRequest
 );
}

// This method opens the dialog and checks the DialogResult value. 
// If the result is OK, the text box's background color will be changed
 
// to the user-selected color.
void Button1_Click( System::Object^ sender, System::EventArgs^
 e )
{
   ::DialogResult result = ColorDialog1->ShowDialog();
   if ( result == ::DialogResult::OK )
   {
      TextBox1->BackColor = ColorDialog1->Color;
   }
}

// This method is called when the HelpRequest event is raised, 
//which occurs when the user clicks the Help button on the ColorDialog
 object.
void ColorDialog1_HelpRequest( Object^ sender, System::EventArgs^
 e )
{
   MessageBox::Show( "Please select a color by clicking it. " +
      "This will change the BackColor property of the TextBox." );
}
// This method initializes colorDialog1 to allow any colors, 
// and combination colors on systems with 256 colors or less, 
// but will not allow the user to set custom colors.  The
// dialog will contain the help button.
private void InitializeColorDialog()
{
    this.colorDialog1 = new System.Windows.Forms.ColorDialog();
    this.colorDialog1.set_AllowFullOpen(false);
    this.colorDialog1.set_AnyColor(true);
    this.colorDialog1.set_SolidColorOnly(false);
    this.colorDialog1.set_ShowHelp(true);
    // Associate the event-handling method with
    // the HelpRequest event.
    this.colorDialog1.add_HelpRequest(new System.EventHandler(
        colorDialog1_HelpRequest));
} //InitializeColorDialog

// This method opens the dialog and checks the DialogResult value. 
// If the result is OK, the text box's background color will be changed
 
// to the user-selected color.
private void button1_Click(System.Object sender,
 System.EventArgs e)
{
    DialogResult result = colorDialog1.ShowDialog();
    if (result.Equals(DialogResult.OK)) {
        textBox1.set_BackColor(colorDialog1.get_Color());
    }
} //button1_Click

// This method is called when the HelpRequest event is raised, 
//which occurs when the user clicks the Help button on the ColorDialog
 object.
private void colorDialog1_HelpRequest(Object
 sender, System.EventArgs e)
{
    MessageBox.Show("Please select a color by clicking it. " 
        + "This will change the BackColor property of the TextBox.");
} //colorDialog1_HelpRequest
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からCommonDialog.HelpRequest イベントを検索した結果を表示しています。
Weblioに収録されているすべての辞書からCommonDialog.HelpRequest イベントを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からCommonDialog.HelpRequest イベント を検索

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

辞書ショートカット

すべての辞書の索引

CommonDialog.HelpRequest イベントのお隣キーワード
検索ランキング

   

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



CommonDialog.HelpRequest イベントのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS