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

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

DataGridColumnStyle.ReadOnlyChanged イベント

ReadOnly プロパティの値が変更され場合発生します

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

Dim instance As DataGridColumnStyle
Dim handler As EventHandler

AddHandler instance.ReadOnlyChanged, handler
public event EventHandler ReadOnlyChanged
/** @event */
public void add_ReadOnlyChanged (EventHandler
 value)

/** @event */
public void remove_ReadOnlyChanged (EventHandler
 value)
JScript では、イベント使用できますが、新規に宣言することはできません。
解説解説
使用例使用例
  Private Sub Button_Click(ByVal
 sender As Object, ByVal
 e As EventArgs)
      If myButton.Text = "Make column read/write"
 Then
          myDataGridColumnStyle.ReadOnly = False
          myButton.Text = "Make column read only"
      Else
          myDataGridColumnStyle.ReadOnly = True
          myButton.Text = "Make column read/write"
      End If
  End Sub 'Button_Click

Private Sub AddCustomDataTableStyle()
   myDataGridTableStyle = New DataGridTableStyle()
   myDataGridTableStyle.MappingName = "Customers"
   myDataGridColumnStyle = New DataGridTextBoxColumn()
   myDataGridColumnStyle.MappingName = "CustName"
   ' Add EventHandler function for readonlychanged event.
   AddHandler myDataGridColumnStyle.ReadOnlyChanged, AddressOf
 myDataGridColumnStyle_ReadOnlyChanged
   myDataGridColumnStyle.HeaderText = "Customer"
   myDataGridTableStyle.GridColumnStyles.Add(myDataGridColumnStyle)
   ' Add the 'DataGridTableStyle' instance to the 'DataGrid'.
   myDataGrid.TableStyles.Add(myDataGridTableStyle)
End Sub 'AddCustomDataTableStyle

  Private Sub myDataGridColumnStyle_ReadOnlyChanged(ByVal
 sender As Object, ByVal
 e As EventArgs)
      MessageBox.Show("'Readonly' property is changed")
  End Sub 'myDataGridColumnStyle_ReadOnlyChanged
private void Button_Click(Object sender, EventArgs
 e)
{ 
   if (myButton.Text == "Make column read/write")
   {
      myDataGridColumnStyle.ReadOnly = false;
      myButton.Text = "Make column read only";
   }
   else
   {
      myDataGridColumnStyle.ReadOnly = true;
      myButton.Text = "Make column read/write";
   }
}

private void AddCustomDataTableStyle()
{
   myDataGridTableStyle = new DataGridTableStyle();
   myDataGridTableStyle.MappingName = "Customers";
   myDataGridColumnStyle = new DataGridTextBoxColumn();
   myDataGridColumnStyle.MappingName= "CustName";
   // Add EventHandler function for readonlychanged event.
   myDataGridColumnStyle.ReadOnlyChanged += new EventHandler(myDataGridColumnStyle_ReadOnlyChanged);
   myDataGridColumnStyle.HeaderText = "Customer";
   myDataGridTableStyle.GridColumnStyles.Add(myDataGridColumnStyle);
   // Add the 'DataGridTableStyle' instance to the 'DataGrid'.
   myDataGrid.TableStyles.Add(myDataGridTableStyle);
}
private void myDataGridColumnStyle_ReadOnlyChanged(Object
 sender, EventArgs e)
{
   MessageBox.Show("'Readonly' property is changed");
}
private:
   void Button_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      if ( myButton->Text->Equals( "Make column read/write"
 ) )
      {
         myDataGridColumnStyle->ReadOnly = false;
         myButton->Text = "Make column read only";
      }
      else
      {
         myDataGridColumnStyle->ReadOnly = true;
         myButton->Text = "Make column read/write";
      }
   }

   void AddCustomDataTableStyle()
   {
      myDataGridTableStyle = gcnew DataGridTableStyle;
      myDataGridTableStyle->MappingName = "Customers";
      myDataGridColumnStyle = gcnew DataGridTextBoxColumn;
      myDataGridColumnStyle->MappingName = "CustName";
      
      // Add EventHandler function for readonlychanged event.
      myDataGridColumnStyle->ReadOnlyChanged += gcnew EventHandler( this,
 &MyForm1::myDataGridColumnStyle_ReadOnlyChanged );
      myDataGridColumnStyle->HeaderText = "Customer";
      myDataGridTableStyle->GridColumnStyles->Add( myDataGridColumnStyle );
      
      // Add the 'DataGridTableStyle' instance to the 'DataGrid'.
      myDataGrid->TableStyles->Add( myDataGridTableStyle );
   }

   void myDataGridColumnStyle_ReadOnlyChanged( Object^ /*sender*/,
 EventArgs^ /*e*/ )
   {
      MessageBox::Show( "'Readonly' property is changed" );
   }
void Button_Click(Object sender, EventArgs e)
{
    if (myButton.get_Text().Equals("Make column read/write"))
 {
        myDataGridColumnStyle.set_ReadOnly(false);
        myButton.set_Text("Make column read only");
    }
    else {
        myDataGridColumnStyle.set_ReadOnly(true);
        myButton.set_Text("Make column read/write");
    }
} //Button_Click

private void AddCustomDataTableStyle()
{
    myDataGridTableStyle = new DataGridTableStyle();
    myDataGridTableStyle.set_MappingName("Customers");
    myDataGridColumnStyle = new DataGridTextBoxColumn();
    myDataGridColumnStyle.set_MappingName("CustName");

    // Add EventHandler function for readonlychanged event.
    myDataGridColumnStyle.add_ReadOnlyChanged(new EventHandler(
        myDataGridColumnStyle_ReadOnlyChanged));
    myDataGridColumnStyle.set_HeaderText("Customer");
    myDataGridTableStyle.get_GridColumnStyles().Add(myDataGridColumnStyle);

    // Add the 'DataGridTableStyle' instance to the 'DataGrid'.
    myDataGrid.get_TableStyles().Add(myDataGridTableStyle);
} //AddCustomDataTableStyle

void myDataGridColumnStyle_ReadOnlyChanged(Object sender, EventArgs
 e)
{
    MessageBox.Show("'Readonly' property is changed");
} //myDataGridColumnStyle_ReadOnlyChanged
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGridColumnStyle クラス
DataGridColumnStyle メンバ
System.Windows.Forms 名前空間



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS