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

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

DataGrid.CaptionVisibleChanged イベント

CaptionVisible プロパティ変更され場合発生します

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

Public Event CaptionVisibleChanged As
 EventHandler
Dim instance As DataGrid
Dim handler As EventHandler

AddHandler instance.CaptionVisibleChanged, handler
public event EventHandler CaptionVisibleChanged
/** @event */
public void add_CaptionVisibleChanged (EventHandler
 value)

/** @event */
public void remove_CaptionVisibleChanged (EventHandler
 value)
JScript では、イベント使用できますが、新規に宣言することはできません。
解説解説
使用例使用例
' Create an instance of the 'CaptionVisibleChanged' EventHandler.
Private Sub CallCaptionVisibleChanged()
   AddHandler myDataGrid.CaptionVisibleChanged, AddressOf
 Grid_CaptionVisibleChanged
End Sub 'CallCaptionVisibleChanged


' Set the 'CaptionVisible' property on click of a button.
 Private Sub myButton_Click(ByVal
 sender As Object, ByVal
 e As EventArgs)
     If myDataGrid.CaptionVisible = True Then
         myDataGrid.CaptionVisible = False
     Else
         myDataGrid.CaptionVisible = True
     End If
 End Sub 'myButton_Click
 
' Raise the event when 'CaptionVisible' property is changed.
 Private Sub Grid_CaptionVisibleChanged(ByVal
 sender As Object, ByVal
 e As EventArgs)
     ' String variable used to show message.
     Dim myString As String
 = "CaptionVisibleChanged event raised, caption is"
     ' Get the state of 'CaptionVisible' property.
     Dim myBool As Boolean
 = myDataGrid.CaptionVisible
     ' Create appropriate alert message.
     myString += IIf(myBool, " ", "
 not ") + "visible"
     ' Show information about caption of DataGrid. 
     MessageBox.Show(myString, "Caption information")
 End Sub 'Grid_CaptionVisibleChanged

// Create an instance of the 'CaptionVisibleChanged' EventHandler.
private void CallCaptionVisibleChanged()
{
   myDataGrid.CaptionVisibleChanged += 
                           new EventHandler(Grid_CaptionVisibleChanged);
}

// Set the 'CaptionVisible' property on click of a button.
private void myButton_Click(object sender,
 EventArgs e)
{
   if (myDataGrid.CaptionVisible == true)
      myDataGrid.CaptionVisible = false;
   else
      myDataGrid.CaptionVisible = true;
}

// Raise the event when 'CaptionVisible' property is changed.
private void Grid_CaptionVisibleChanged(object
 sender, EventArgs e)
{
   // String variable used to show message.
   string myString = "CaptionVisibleChanged event raised,
 caption is";
   // Get the state of 'CaptionVisible' property.
   bool myBool = myDataGrid.CaptionVisible;
   // Create appropriate alert message.
   myString += (myBool ? " " : " not ") + "visible";
   // Show information about caption of DataGrid. 
   MessageBox.Show(myString, "Caption information");
}
   // Create an instance of the 'CaptionVisibleChanged' EventHandler.
private:
   void CallCaptionVisibleChanged()
   {
      myDataGrid->CaptionVisibleChanged += gcnew EventHandler( this,
 &MyDataGrid::Grid_CaptionVisibleChanged );
   }

   // Set the 'CaptionVisible' property on click of a button.
   void myButton_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      if ( myDataGrid->CaptionVisible == true
 )
            myDataGrid->CaptionVisible = false;
      else
            myDataGrid->CaptionVisible = true;
   }

   // Raise the event when 'CaptionVisible' property is changed.
   void Grid_CaptionVisibleChanged( Object^ /*sender*/, EventArgs^
 /*e*/ )
   {
      // String variable used to show message.
      String^ myString = "CaptionVisibleChanged event raised, caption is";

      // Get the state of 'CaptionVisible' property.
      bool myBool = myDataGrid->CaptionVisible;

      // Create appropriate alert message.
      myString = String::Concat( myString, myBool ? (String^)" " : "
 not ", "visible" );

      // Show information about caption of DataGrid.
      MessageBox::Show( myString, "Caption information" );
   }
// Create an instance of the 'CaptionVisibleChanged' EventHandler.
private void CallCaptionVisibleChanged()
{
    myDataGrid.add_CaptionVisibleChanged(new EventHandler(
        GridCaptionVisibleChanged));
} //CallCaptionVisibleChanged

// Set the 'CaptionVisible' property on click of a button.
protected void myButton_Click(Object sender,
 EventArgs e)
{
    if (myDataGrid.get_CaptionVisible() == true)
 {
        myDataGrid.set_CaptionVisible(false);
    }
    else {
        myDataGrid.set_CaptionVisible(true);
    }
} //myButton_Click

// Raise the event when 'CaptionVisible' property is changed.
protected void GridCaptionVisibleChanged(Object
 sender, EventArgs e)
{
    // String variable used to show message.
    String myString = "CaptionVisibleChanged event raised, caption is";

    // Get the state of 'CaptionVisible' property.
    boolean myBool = myDataGrid.get_CaptionVisible();

    // Create appropriate alert message.
    myString += (myBool ? " " : " not ") + "visible";

    // Show information about caption of DataGrid. 
    MessageBox.Show(myString, "Caption information");
} //GridCaptionVisibleChanged
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS