Button.PerformClick メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Button.PerformClick メソッドの意味・解説 

Button.PerformClick メソッド

ボタンClick イベント生成します

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

Public Sub PerformClick
Dim instance As Button

instance.PerformClick
public void PerformClick ()
public:
virtual void PerformClick () sealed
public final void PerformClick ()
解説解説
使用例使用例

他のボタンClick イベント発生したときに、一回おきに ButtonClick イベント生成するコード例次に示します。このコードは、2 つButton コントロールフォーム上でインスタンス化され、myVar という名前のメンバ変数クラス内の 32 ビット符号付き整数として宣言されていることを前提にしています。

Private Sub button1_Click(sender As
 Object, e As EventArgs)
    ' If myVar is an even number, click Button2.
    If myVar Mod 2 = 0 Then
        button2.PerformClick()
        ' Display the status of Button2's Click event.
        MessageBox.Show("button2 was clicked ")
    Else
        ' Display the status of Button2's Click event.
        MessageBox.Show("button2 was NOT clicked")
    End If
    ' Increment myVar.   
    myVar = myVar + 1
End Sub 'button1_Click
private void button1_Click (Object sender,
 
                               EventArgs e)
 {
    // If myVar is an even number, click Button2.
    if(myVar %2 == 0)
    {
       button2.PerformClick();
       // Display the status of Button2's Click event.
       MessageBox.Show("button2 was clicked ");
    }
    else
    {
       // Display the status of Button2's Click event.
       MessageBox.Show("button2 was NOT clicked");
    }
    // Increment myVar.   
    myVar = myVar + 1;
 }
 
private:
   void button1_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      // If myVar is an even number, click Button2.
      if ( myVar % 2 == 0 )
      {
         button2->PerformClick();
         // Display the status of Button2's Click event.
         MessageBox::Show( "button2 was clicked " );
      }
      else
      {
         // Display the status of Button2's Click event.
         MessageBox::Show( "button2 was NOT clicked" );
      }
      // Increment myVar.   
      myVar++;
   }
private void button1_Click(Object sender, EventArgs
 e)
{
    // If myVar is an even number, click Button2.
    if (myVar % 2 == 0) {
        button2.PerformClick();
        // Display the status of Button2's Click event.
        MessageBox.Show("button2 was clicked ");
    }
    else {
        // Display the status of Button2's Click event.
        MessageBox.Show("button2 was NOT clicked");
    }
    // Increment myVar.   
    myVar = myVar + 1;
} //button1_Click
protected function button1_Click (sender :
 Object, e : EventArgs)
 {
    // If myVar is an even number, click Button2.
    if(myVar %2 == 0)
    {
       button2.PerformClick();
       // Display the status of Button2's Click event.
       MessageBox.Show("button2 was clicked ");
    }
    else
    {
       // Display the status of Button2's Click event.
       MessageBox.Show("button2 was NOT clicked");
    }
    // Increment myVar.   
    myVar = myVar + 1;
 }
 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

Button.PerformClick メソッドのお隣キーワード
検索ランキング

   

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



Button.PerformClick メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS