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

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

BindingManagerBase.PositionChanged イベント

Position プロパティの値が変更された後に発生します

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

Dim instance As BindingManagerBase
Dim handler As EventHandler

AddHandler instance.PositionChanged, handler
public event EventHandler PositionChanged
/** @event */
public void add_PositionChanged (EventHandler
 value)

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

Binding作成してTextBox コントロールBinding オブジェクトコレクション追加するコード例次に示します。さらに、この例ではデータ ソース対する BindingManagerBase を取得しPositionChanged イベントデリゲート追加してます。

Protected Sub BindControl()
    ' Create a Binding object for the TextBox control.
    ' The data-bound property for the control is the Text
    ' property. 
    Dim myBinding As New
 Binding("Text", ds, "customers.custName")
    
    text1.DataBindings.Add(myBinding)
    
    ' Get the BindingManagerBase for the Customers table. 
    Dim bmCustomers As BindingManagerBase =
 Me.BindingContext(ds, "Customers")
    
    ' Add the delegate for the PositionChanged event.
    AddHandler bmCustomers.PositionChanged, AddressOf
 Position_Changed
End Sub 'BindControl


Private Sub Position_Changed(sender As
 Object, e As EventArgs)
    ' Print the Position property value when it changes.
    Console.WriteLine(CType(sender, BindingManagerBase).Position)
End Sub 'Position_Changed
protected void BindControl()
{
   /* Create a Binding object for the TextBox control. 
   The data-bound property for the control is the Text 
   property. */
   Binding myBinding = 
   new Binding("Text", ds, "customers.custName");

   text1.DataBindings.Add(myBinding);

   // Get the BindingManagerBase for the Customers table. 
   BindingManagerBase bmCustomers = 
   this.BindingContext [ds, "Customers"];

   // Add the delegate for the PositionChanged event.
   bmCustomers.PositionChanged += 
   new EventHandler(Position_Changed);
}

private void Position_Changed(object sender,
 EventArgs e)
{
   // Print the Position property value when it changes.
   Console.WriteLine(((BindingManagerBase)sender).Position);
}

   void BindControl()
   {
      
      /* Create a Binding object for the TextBox control. 
         The data-bound property for the control is the Text 
         property. */
      Binding^ myBinding = gcnew Binding( "Text",ds,"customers.custName"
 );
      text1->DataBindings->Add( myBinding );
      
      // Get the BindingManagerBase for the Customers table. 
      BindingManagerBase^ bmCustomers = this->BindingContext[
 ds,"Customers" ];
      
      // Add the delegate for the PositionChanged event.
      bmCustomers->PositionChanged += gcnew EventHandler( this,
 &Form1::Position_Changed );
   }


private:
   void Position_Changed( Object^ sender, EventArgs^ /*e*/ )
   {
      
      // Print the Position property value when it changes.
      Console::WriteLine( (dynamic_cast<BindingManagerBase^>(sender))->Position
 );
   }

protected void BindControl()
{
    /* Create a Binding object for the TextBox control. 
       The data-bound property for the control is the Text 
       property. 
     */
    Binding myBinding = new Binding("Text", ds, "customers.custName");
    text1.get_DataBindings().Add(myBinding);

    // Get the BindingManagerBase for the Customers table. 
    BindingManagerBase bmCustomers =  
        this.get_BindingContext().get_Item(ds, "Customers");

    // Add the delegate for the PositionChanged event.
    bmCustomers.add_PositionChanged(new EventHandler(Position_Changed));
} //BindControl

private void Position_Changed(Object sender,
 EventArgs e)
{
    // Print the Position property value when it changes.
    Console.WriteLine(((BindingManagerBase)(sender)).get_Position());
} //Position_Changed
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「BindingManagerBase.PositionChanged イベント」の関連用語

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

   

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



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

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

©2024 GRAS Group, Inc.RSS