bindingとは? わかりやすく解説

binding

別表記:バインディング

「binding」とは、縛ること・束ねるもの・製本などのことを意味する英語表現である。

「binding」の基本的な意味

「binding」は、縛ることや束ねるもの、製本や装丁などといった意味を持つ表現である。動詞である「bind」の現在分詞形であり、名詞や形容詞として使われる。

「binding」の語源

「binding」の語源はゲルマン祖語で「縛る」を意味するbindanaであるとされている。

「binding」の発音・読み方

「binding」は「バインディング」と読む。発音記号は米国英語で「ˈbaɪndiŋ」であり、音節は「bínd・ing」である。

「binding」を含む英熟語・英語表現

「binding protein」とは


「binding protein」とは、「結合タンパク質」のことである。結合タンパク質とは、決まった分子と結合するタンパク質のことである。主に生物学や化学で使われることが多い。例えば、DNA結合タンパク質はDNAと特異的に結合するタンパク質であり、結合することによって、DNAの修復や複製、転写調節などに関与している。配列に特異的に結合するタイプと、どのような配列であっても結合できるタイプがあり、それぞれ関与している反応は異なる。このように、各結合タンパク質にはそれぞれ特徴があり、結合先もDNAだけではなく、RNAやタンパク質、脂質、金属など様々である。

「Non-binding」とは


「Non-binding」とは、「法的拘束力のない」という意味である。英語で契約書を作成する時などに使われる用語であり、「Legally Non-Binding」と呼ばれることもある。逆に、「binding」や「Legally binding」は「法的に拘束する」という意味になる。契約とは基本的に、契約した当事者同士の意思が最も尊重されることが多く、お互いの意思に基づいて合意したのであれば、契約に法的拘束力が発生するとされている国が多い。このことによる不当な契約の解除やペナルティを避けるために、あえて「Non-binding」の一文を契約書に付け加えることがある。

「legally binding」とは


「legally binding」とは、「法的に拘束する」という意味の表現である。「binding」だけでも同じ意味の表現として扱われるが、正確に「法的に拘束する」と表現したい時は、「legally binding」を使う。英語での契約書を作成する際に見られる表現である。基本的に、契約書に記載された内容は、その契約書が締結されることによって、法的拘束力を持つものになる。つまり、改めて「法的に拘束する」と宣言しなくとも、契約書が締結されたのであれば、それは法的拘束力を持つと見なされる場合が多い。だが、一般的に予備的合意の段階では法的拘束力がないとされることが多く、これに法的拘束力を持たせたい場合に、「legally binding」と表記することによって、正式な契約を交わす前の予備的合意であっても、法的拘束力を持つものにすることができる。

「be binding」とは


bindingはbindの現在分詞形であるため、bindingにbe動詞を合わせると進行形になり、「~しているところ」というように訳すことができる。「be binding」は、bindingの持つ意味と照らし合わせて、「拘束力」や「拘束力がある」と表現されることが多い。

「BINDing (ネコぱら) 1/4 スケール」とは

「BINDing (ネコぱら) 1/4 スケール」とは、フィギュアメーカーである「BINDing」から発売されている「ネコぱら」というゲームのキャラクター の1/4 スケールフィギュアのことである。ネコぱらとは、NEKO WORKsが制作した同人ゲームであり、擬人化した猫のヒロイン達との恋愛アドベンチャーゲームであり、2020年にはアニメ化もされている。フルボイスで、アニメーションのようにキャラクターが動くのが特徴である。2014年から配信されており、配信当初から日本語だけではなく、英語と中国語にも対応している。

「binding」の使い方・例文

「binding」を使った例文として、
・Create a legally non-binding contract.(法的拘束力のない契約書を作成する)
・She bought a carpet with a gold thread binding.(彼女は金糸の縁取りがしてある絨毯を購入した)
・Single-stranded DNA-binding proteins are a type of DNA-binding protein.(一本鎖DNA結合タンパク質は、DNA結合タンパク質の一種である)
・There are many types of binding proteins.(結合タンパク質には多くの種類がある)
などが挙げられる。

バインディング【binding】

読み方:ばいんでぃんぐ

1 ラグビーで、スクラムやラック、モールなどで味方選手どうしががっちりと組み合うこと。スクラムの場合は、敵味方が互いに組み合うこともいう。

2 スキーやスノーボードを靴に取り付けるための締め具。ビンディング。

3 コンピューターや情報工学の分野で、複数の事柄どうしを結びつけたり対応づけたりすること。特定のコンピューターへのIPアドレスの割り当てや、プログラミング言語における、API・ライブラリー・関数との対応づけのほか、アプリケーションソフトでキー操作と機能を結びつけること(キーバインディング)など。


Binding イベント


Binding クラス

名前空間: Microsoft.JScript
アセンブリ: Microsoft.JScript (microsoft.jscript.dll 内)
構文構文

Public MustInherit Class
 Binding
    Inherits AST
public abstract class Binding extends AST
public abstract class Binding extends
 AST
継承階層継承階層
System.Object
   Microsoft.JScript.AST
    Microsoft.JScript.Binding
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Binding クラス

XML Web サービスで使用される具象データの形式およびプロトコルを指定します。このクラスは継承できません。

名前空間: System.Web.Services.Description
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文構文

Public NotInheritable Class
 Binding
    Inherits NamedItem
public sealed class Binding : NamedItem
public ref class Binding sealed : public
 NamedItem
public final class Binding extends NamedItem
public final class Binding extends
 NamedItem
解説解説
使用例使用例

Binding クラスの一般的な使用例を次に示します。

' Get Binding Name = "MathServiceSoap".
myBinding = myServiceDescription.Bindings("MathServiceHttpGet")
If Not (myBinding Is Nothing)
 Then
   Console.WriteLine((ControlChars.Cr + ControlChars.Cr + "Name
 : " + myBinding.Name))
   Console.WriteLine(("Type : " + myBinding.Type.ToString()))
End If
// Get Binding Name = "MathServiceSoap".
myBinding = myServiceDescription.Bindings["MathServiceHttpGet"];
if (myBinding != null)
{
   Console.WriteLine("\n\nName : " + myBinding.Name);
   Console.WriteLine("Type : " + myBinding.Type);
}
// Get Binding Name = S"MathServiceSoap".
myBinding = myServiceDescription->Bindings[ "MathServiceHttpGet" ];
if ( myBinding != nullptr )
{
   Console::WriteLine( "\n\nName : {0}", myBinding->Name );
   Console::WriteLine( "Type : {0}", myBinding->Type );
}
// Get Binding Name = "MathServiceSoap".
myBinding = myServiceDescription.get_Bindings().
    get_Item("MathServiceHttpGet");
if (myBinding != null) {
    Console.WriteLine("\n\nName : " + myBinding.get_Name());
    Console.WriteLine("Type : " + myBinding.get_Type());
}
継承階層継承階層
System.Object
   System.Web.Services.Description.DocumentableItem
     System.Web.Services.Description.NamedItem
      System.Web.Services.Description.Binding
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Binding メンバ
System.Web.Services.Description 名前空間

Binding クラス

オブジェクトのプロパティ値とコントロールのプロパティ値との間の単純バインディングを表します。

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

解説解説

Binding クラスを使用して、オブジェクトのプロパティまたはオブジェクトのリスト内にある現在のオブジェクトのプロパティのいずれかと、コントロールのプロパティとの間に、単純バインディングを作成して維持します。

前者の例として、Customer オブジェクトの FirstName プロパティに、TextBox コントロールの Text プロパティをバインドできます。後者の例として、顧客データを格納している DataTable の FirstName プロパティに、TextBox コントロールの Text プロパティをバインドできます。

また、Binding クラスを使用すると、Format イベントを通じて表示する値の書式を設定したり、書式設定された値を Parse イベントを通じて取得したりすることもできます。

Binding コンストラクタで Binding のインスタンスを作成する場合は、次の 3 つの項目を指定する必要があります。

まず、データのバインド先とするコントロールのプロパティ名を指定する必要があります。たとえば、TextBox コントロールにデータを表示するには、Text プロパティを指定します。

その後、次の表に示すいずれかのクラスのインスタンスをデータ ソースとして指定できます。

説明

C# の例

IBindingList または ITypedList を実装する任意のクラス。これらのクラスには、DataSet、DataTable、DataView、DataViewManager などがあります。

DataSet ds = new DataSet("myDataSet");

IList を実装し、オブジェクトのインデックス付きコレクションを作成する任意のクラス。このコレクションは、Binding を作成する前に作成され、その中にオブジェクトが格納されていることが必要です。リスト内のオブジェクトの型は、すべて同じである必要があります。それ以外の場合は、例外がスローされます。

ArrayList ar1 = new ArrayList;

Customer1 cust1 = new Customer("Louis");

ar1.Add(cust1);

厳密に型指定されたオブジェクトの、厳密に型指定された IList。

Customer [] custList = new Customer[3];

3 番目に、ナビゲーション パスを指定する必要があります。ナビゲーション パスには、空の文字列 ("")、単一のプロパティ名、またはピリオドで区切られた名前の階層を指定できます。ナビゲーション パスに空の文字列を設定した場合は、基になるデータ ソース オブジェクトに対して ToString メソッドが呼び出されます。

データ ソースが複数の DataColumn オブジェクトを格納できる DataTable の場合は、ナビゲーション パスを使用して、特定の列に解決する必要があります。

メモメモ

データ ソースが DataSet、DataViewManager、または DataTable の場合、実際には DataView にバインドされています。つまり、バインドされている行は、実際には DataRowView オブジェクトです。

複数の DataTable オブジェクトを格納するオブジェクト (DataSet、DataViewManager など) がデータ ソースとして設定されている場合は、ピリオド区切りのナビゲーション パスが必要です。他のオブジェクトへの参照を返すプロパティを持つオブジェクト (他のクラス オブジェクトを返すプロパティを持つクラスなど) にバインドする場合も、ピリオド区切りのナビゲーション パスを使用できます。たとえば、次のナビゲーション パスはすべて有効なデータ フィールドを記述しています。

  • "Size.Height"

  • "Suppliers.CompanyName"

  • "Regions.regionsToCustomers.CustomerFirstName"

  • "Regions.regionsToCustomers.customersToOrders.ordersToDetails.Quantity"

パスの各メンバは、整数などの単一の値に解決されるプロパティ、または文字列配列などの値のリストを返す場合があります。パスの各メンバはリストまたはプロパティである可能性がありますが、最終メンバはプロパティに解決されることが必要です。各メンバは、1 つ前のメンバに基づいています。"Size.Height" は、現在の Size の Height プロパティに解決されます。"Regions.regionsToCustomers.CustomerFirstName" は、現在の領域の顧客の 1 人である顧客の名前に解決されます。

DataRelation は、DataSet 内で 1 つの DataTable を次の DataTable にリンクすることによって値のリストを返します。DataSet に DataRelation オブジェクトが格納されている場合は、データ メンバとして、TableName の後に RelationName、さらに ColumnName を続けて指定できます。たとえば、"Suppliers" という名前の DataTable が "suppliers2products" という名前の DataRelation を格納している場合、データ メンバは "Suppliers.suppliers2products.ProductName" となります。

データ ソースは、関連する一連のクラスで構成されます。たとえば、太陽系を形成する一連のクラスを想定します。System という名前のクラスは、Star オブジェクトのコレクションを返す Stars という名前のプロパティを格納します。各 Star オブジェクトには、Name プロパティ、Mass プロパティ、および Planet オブジェクトのコレクションを返す Planets プロパティがあります。このシステムでは、各 planet にも Mass プロパティおよび Name プロパティがあります。さらに、各 Planet オブジェクトには、Moon オブジェクトのコレクションを返す Moons プロパティがあり、各 Moon オブジェクトにも Name プロパティおよび Mass プロパティがあります。データ ソースとして System オブジェクトを指定する場合は、データ メンバとして次のいずれかを指定できます。

  • "Stars.Name"

  • "Stars.Mass"

  • "Stars.Planets.Name"

  • "Stars.Planets.Mass"

  • "Stars.Planets.Moons.Name"

  • "Stars.Planets.Moons.Mass"

単純バインドできるコントロールには、ControlBindingsCollection に格納される Binding オブジェクトのコレクションが関連付けられています。このコレクションには、そのコントロールの DataBindings プロパティを通じてアクセスできます。このコレクションに Binding を追加するには、Add メソッドを呼び出します。これにより、コントロールのプロパティがオブジェクトのプロパティ、またはリスト内の現在のオブジェクトのプロパティにバインドされます。

たとえば、次の Windows コントロールなど、System.Windows.Forms.Control クラスから派生した任意のオブジェクトに単純バインドできます。

メモメモ

ComboBox、CheckedListBox、ListBox の各コントロールについては、SelectedValue プロパティだけが単純バインドされます。

BindingManagerBase クラスは、特定のデータ ソースおよびデータ メンバの Binding オブジェクトをすべて管理する抽象クラスです。CurrencyManager クラスおよび PropertyManager クラスは、BindingManagerBase から派生したクラスです。Binding がどのように管理されるかは、Binding がリスト バインディングまたはプロパティ バインディングのいずれであるかによって決まります。たとえば、リスト バインディングの場合は、BindingManagerBase を使用して、リスト内の Position を指定できます。その Position によって、リスト内の全項目のうち、コントロールに実際にバインドされる項目が決まります。適切な BindingManagerBase を返すには、BindingContext を使用します。

同じ DataSource にバインドされている一連のコントロールに新しい行を追加するには、BindingManagerBase クラスの AddNew メソッドを使用します。適切な CurrencyManager を返すには、BindingContext クラスの Item プロパティを使用します。新しい行の追加をキャンセルするには、CancelCurrentEdit メソッドを使用します。

使用例使用例

単純データ バインディングを行うコントロールがいくつか配置されている Windows フォームの作成例を次に示します。この例では、Customers および Orders という名前の 2 つのテーブルを持つ DataSet と、custToOrders という名前の DataRelation を作成します。4 つのコントロール (1 つの DateTimePicker コントロールと 3 つの TextBox コントロール) は、テーブル内の列にデータ連結されています。この例は、各コントロールに対して Binding を作成し、それぞれのコントロールに DataBindings プロパティを通じて追加します。また、フォームの BindingContext を通じて、各テーブルの BindingManagerBase を返します。4 つの Button コントロールが、BindingManagerBase オブジェクトの Position プロパティをインクリメントまたはデクリメントします。

Imports System
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Globalization
Imports System.Windows.Forms

Public Class Form1
   Inherits Form

   Private components As Container
   Private button1 As Button
   Private button2 As Button
   Private button3 As Button
   Private button4 As Button
   Private text1 As TextBox
   Private text2 As TextBox
   Private text3 As TextBox

   Private bmCustomers As BindingManagerBase
   Private bmOrders As BindingManagerBase
   Private ds As DataSet
   Private DateTimePicker1 As DateTimePicker
   
   Public Sub New
      ' Required for Windows Form Designer support.
      InitializeComponent
      ' Call SetUp to bind the controls.
      SetUp
   End Sub

   Protected Overloads Overrides
 Sub Dispose(ByVal disposing As
 Boolean)
      If disposing Then
         If Not (components Is
 Nothing) Then
            components.Dispose()
         End If
      End If
      MyBase.Dispose(disposing)
    End Sub


   Private Sub InitializeComponent
      ' Create the form and its controls.
      With Me
         .components = New Container
         .button1 = New Button
         .button2 = New Button
         .button3 = New Button
         .button4 = New Button
         .text1 = New TextBox
         .text2 = New TextBox
         .text3 = New TextBox

         .DateTimePicker1 = New DateTimePicker
         
         .Text = "Binding Sample"
         .ClientSize = New Size(450, 200)

         With .button1
            .Location = New Point(24, 16)
            .Size = New Size(64, 24)
            .Text = "<"
            AddHandler button1.click, AddressOf
 button1_Click
         End With
         
         
         With .button2
            .Location = New Point(90, 16)
            .Size = New Size(64, 24)
            .Text = ">"
            AddHandler button2.click, AddressOf
 button2_Click
         End With
         
         With .button3
            .Location = New Point(90, 100)
            .Size = New Size(64, 24)
            .Text = ">"
            AddHandler button3.click, AddressOf
 button3_Click
         End With

         With .button4
            .Location = New Point(150, 100)
            .Size = New Size(64, 24)
            .Text = ">"
            AddHandler button4.click, AddressOf
 button4_Click
         End With

         With .text1
            .Location = New Point(24, 50)
            .Size = New Size(150, 24)
         End With

         With .text2
            .Location = New Point(190, 50)
            .Size = New Size(150, 24)
         End With

         With .text3
            .Location = New Point(290, 150)
            .Size = New Size(150, 24)
         End With

            With .DateTimePicker1
               .Location = New Point(90, 150)
               .Size = New Size(200, 800)
            End With

            With .Controls
            .Add(button1)
            .Add(button2)
            .Add(button3)
            .Add(button4)
            .Add(text1)
            .Add(text2)
            .Add(text3)
            .Add(DateTimePicker1)
            End With
      End With
   End Sub
      
   Public Shared Sub Main
      Application.Run(new Form1)
   End Sub

   Private Sub SetUp
      ' Create a DataSet with two tables and one relation.
      MakeDataSet
      BindControls
   End Sub

   Private Sub BindControls
      ' Create two Binding objects for the first two TextBox
      ' controls. The data-bound property for both controls
      ' is the Text property.  The data source is a DataSet
      ' (ds). The data member is the 
      ' TableName.ColumnName" string.

      text1.DataBindings.Add(New _
         Binding("Text", ds, "customers.custName"))
      text2.DataBindings.Add(New _
         Binding("Text", ds, "customers.custID"))
      ' Bind the DateTimePicker control by adding a new Binding.
      ' The data member of the DateTimePicker is a
      ' TableName.RelationName.ColumnName string
      DateTimePicker1.DataBindings.Add(New _
         Binding("Value", ds, "customers.CustToOrders.OrderDate"))
      ' Add event delegates for the Parse and Format events to a
      ' new Binding object, and add the object to the third
      ' TextBox control's BindingsCollection. The delegates
      ' must be added before adding the Binding to the
      ' collection; otherwise, no formatting occurs until
      ' the Current object of the BindingManagerBase for
      ' the data source changes.
      Dim b As Binding = New
 _
         Binding("Text", ds, "customers.custToOrders.OrderAmount")
      AddHandler b.Parse, AddressOf CurrencyStringToDecimal
      AddHandler b.Format, AddressOf DecimalToCurrencyString
      text3.DataBindings.Add(b)
      
         ' Get the BindingManagerBase for the Customers table.
         bmCustomers = Me.BindingContext(ds, "Customers")

         ' Get the BindingManagerBase for the Orders table using the
         ' RelationName.
         bmOrders = Me.BindingContext(ds, "customers.CustToOrders")
   End Sub

   Private Sub DecimalToCurrencyString(sender
 As Object, cevent As ConvertEventArgs)
      ' This method is the Format event handler. Whenever the 
      ' control displays a new value, the value is converted from 
      ' its native Decimal type to a string. The ToString method 
      ' then formats the value as a Currency, by using the 
      ' formatting character "c".

      ' The application can only convert to string type. 
   
      If Not cevent.DesiredType Is
 GetType(String) Then
         Exit Sub
      End If 
   
      cevent.Value = CType(cevent.Value, decimal).ToString("c")
   End Sub

   Private Sub CurrencyStringToDecimal(sender
 As Object, cevent As ConvertEventArgs)
      ' This method is the Parse event handler. The Parse event 
      ' occurs whenever the displayed value changes. The static 
      ' ToDecimal method of the Convert class converts the 
      ' value back to its native Decimal type.

      ' Can only convert to decimal type.
      If Not cevent.DesiredType Is
 GetType(decimal) Then
         Exit Sub
      End If

      cevent.Value = Decimal.Parse(cevent.Value.ToString, _
      NumberStyles.Currency, nothing)
      
      ' To see that no precision is lost, print the unformatted 
      ' value. For example, changing a value to "10.0001"
 
      ' causes the control to display "10.00", but the 
      ' unformatted value remains "10.0001".
      Console.WriteLine(cevent.Value)
   End Sub

   Private Sub button1_Click(sender As
 Object, e As System.EventArgs)
      ' Go to the previous item in the Customer list.
      bmCustomers.Position -= 1
   End Sub

   Private Sub button2_Click(sender As
 Object, e As System.EventArgs)
      ' Go to the next item in the Customer list.
      bmCustomers.Position += 1
   End Sub

   Private Sub button3_Click(sender As
 Object, e As System.EventArgs)
      ' Go to the previous item in the Order list.
      bmOrders.Position -= 1
   End Sub

   Private Sub button4_Click(sender As
 Object, e As System.EventArgs)
      ' Go to the next item in the Orders list.
      bmOrders.Position += 1
   End Sub

   ' Creates a DataSet with two tables and populates it.
   Private Sub MakeDataSet
      ' Create a DataSet.
      ds = New DataSet("myDataSet")

      ' Creates two DataTables.
      Dim tCust As DataTable = New
 DataTable("Customers")
      Dim tOrders As DataTable = New
 DataTable("Orders")

      ' Create two columns, and add them to the first table.
      Dim cCustID As DataColumn = New
 DataColumn("CustID", _
      System.Type.GetType("System.Int32"))
      Dim cCustName As DataColumn = New
 DataColumn("CustName")
      tCust.Columns.Add(cCustID)
      tCust.Columns.Add(cCustName)

      ' Create three columns, and add them to the second table.
      Dim cID As DataColumn = _
         New DataColumn("CustID",
 System.Type.GetType("System.Int32"))
      Dim cOrderDate As DataColumn = _
         New DataColumn("orderDate",
 System.Type.GetType("System.DateTime"))
      Dim cOrderAmount As DataColumn = _
         New DataColumn("OrderAmount",
 System.Type.GetType("System.Decimal"))
      tOrders.Columns.Add(cOrderAmount)
      tOrders.Columns.Add(cID)
      tOrders.Columns.Add(cOrderDate)

      ' Add the tables to the DataSet.
      ds.Tables.Add(tCust)
      ds.Tables.Add(tOrders)

      ' Create a DataRelation, and add it to the DataSet.
      Dim dr As DataRelation = New
 _
         DataRelation("custToOrders", cCustID, cID)
      ds.Relations.Add(dr)
      
      ' Populate the tables. For each customer and orders,
      ' create two DataRow variables.
      Dim newRow1 As DataRow
      Dim newRow2 As DataRow

         ' Create three customers in the Customers Table.
         Dim i As Integer
         For i = 1 to 3
            newRow1 = tCust.NewRow
            newRow1("custID") = i
            ' Adds the row to the Customers table.
            tCust.Rows.Add(newRow1)
         Next

         ' Give each customer a distinct name.
         tCust.Rows(0)("custName") = "Alpha"
         tCust.Rows(1)("custName") = "Beta"
         tCust.Rows(2)("custName") = "Omega"

         ' For each customer, create five rows in the Orders table.
         Dim j As Integer
         For i = 1 to 3
         For j = 1 to 5
            newRow2 = tOrders.NewRow
            newRow2("CustID") = i
            newRow2("orderDate") = New
 DateTime(2001, i, j * 2)
            newRow2("OrderAmount") = i * 10 + j *
 .1
            ' Add the row to the Orders table.
            tOrders.Rows.Add(newRow2)
         Next
         Next
   End Sub
End Class
using System;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Windows.Forms;

public class Form1 : System.Windows.Forms.Form
{
   private System.ComponentModel.Container components;
   private Button button1;
   private Button button2;
   private Button button3;
   private Button button4;
   private TextBox text1;
   private TextBox text2;
   private TextBox text3;

   private BindingManagerBase bmCustomers;
   private BindingManagerBase bmOrders;
   private DataSet ds;
   private DateTimePicker DateTimePicker1;

   public Form1()
   {
      // Required for Windows Form Designer support.
      InitializeComponent();
      // Call SetUp to bind the controls.
      SetUp();
   }
 
   private void InitializeComponent()
   {
      // Create the form and its controls.
      this.components = new System.ComponentModel.Container();
      this.button1 = new System.Windows.Forms.Button();
      this.button2 = new System.Windows.Forms.Button();
      this.button3 = new System.Windows.Forms.Button();
      this.button4 = new System.Windows.Forms.Button();
      
      this.text1= new System.Windows.Forms.TextBox();
      this.text2= new System.Windows.Forms.TextBox();
      this.text3= new System.Windows.Forms.TextBox();
      
      this.DateTimePicker1 = new DateTimePicker();
      
      this.Text = "Binding Sample";
      this.ClientSize = new System.Drawing.Size(450,
 200);
      
      button1.Location = new System.Drawing.Point(24, 16);
      button1.Size = new System.Drawing.Size(64, 24);
      button1.Text = "<";
      button1.Click+=new System.EventHandler(button1_Click);

      button2.Location = new System.Drawing.Point(90, 16);
      button2.Size = new System.Drawing.Size(64, 24);
      button2.Text = ">";
      button2.Click+=new System.EventHandler(button2_Click);

      button3.Location = new System.Drawing.Point(90, 100);
      button3.Size = new System.Drawing.Size(64, 24);
      button3.Text = "<";
      button3.Click+=new System.EventHandler(button3_Click);

      button4.Location = new System.Drawing.Point(150, 100);
      button4.Size = new System.Drawing.Size(64, 24);
      button4.Text = ">";
      button4.Click+=new System.EventHandler(button4_Click);

      text1.Location = new System.Drawing.Point(24, 50);
      text1.Size = new System.Drawing.Size(150, 24);

      text2.Location = new System.Drawing.Point(190, 50);
      text2.Size = new System.Drawing.Size(150, 24);

      text3.Location = new System.Drawing.Point(290, 150);
      text3.Size = new System.Drawing.Size(150, 24);
      
      DateTimePicker1.Location = new System.Drawing.Point(90,
 150);
      DateTimePicker1.Size = new System.Drawing.Size(200, 800);
      
      this.Controls.Add(button1);
      this.Controls.Add(button2);
      this.Controls.Add(button3);
      this.Controls.Add(button4);
      this.Controls.Add(text1);
      this.Controls.Add(text2);
      this.Controls.Add(text3);
      this.Controls.Add(DateTimePicker1);
   }

   protected override void Dispose( bool
 disposing ){
      if( disposing ){
         if (components != null){
            components.Dispose();}
      }
      base.Dispose( disposing );
   }
   public static void Main()
   {
      Application.Run(new Form1());
   }
   
   private void SetUp()
   {
      // Create a DataSet with two tables and one relation.
      MakeDataSet();
      BindControls();
   }

   protected void BindControls()
   {
      /* Create two Binding objects for the first two TextBox
 
         controls. The data-bound property for both controls 
         is the Text property. The data source is a DataSet 
         (ds). The data member is the  
         "TableName.ColumnName" string. */
      text1.DataBindings.Add(new Binding
      ("Text", ds, "customers.custName"));
      text2.DataBindings.Add(new Binding
      ("Text", ds, "customers.custID"));
      
      /* Bind the DateTimePicker control by adding a new Binding.
 
         The data member of the DateTimePicker is a 
         TableName.RelationName.ColumnName string. */
      DateTimePicker1.DataBindings.Add(new 
      Binding("Value", ds, "customers.CustToOrders.OrderDate"));

      /* Add event delegates for the Parse and Format events to
 a 
         new Binding object, and add the object to the third 
         TextBox control's BindingsCollection. The delegates 
         must be added before adding the Binding to the 
         collection; otherwise, no formatting occurs until 
         the Current object of the BindingManagerBase for 
         the data source changes. */
         Binding b = new Binding
         ("Text", ds, "customers.custToOrders.OrderAmount");
      b.Parse+=new ConvertEventHandler(CurrencyStringToDecimal);
      b.Format+=new ConvertEventHandler(DecimalToCurrencyString);
      text3.DataBindings.Add(b);

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

      /* Get the BindingManagerBase for the Orders table using
 the 
         RelationName. */ 
      bmOrders = this.BindingContext[ds, "customers.CustToOrders"];
   }

   private void DecimalToCurrencyString(object
 sender, ConvertEventArgs cevent)
   {
      /* This method is the Format event handler. Whenever the 
         control displays a new value, the value is converted
 from 
         its native Decimal type to a string. The ToString method
 
         then formats the value as a Currency, by using the 
         formatting character "c". */

      // The application can only convert to string type. 
      if(cevent.DesiredType != typeof(string))
 return;

      cevent.Value = ((decimal) cevent.Value).ToString("c");
   }

   private void CurrencyStringToDecimal(object
 sender, ConvertEventArgs cevent)
   {   
      /* This method is the Parse event handler. The Parse event 
         occurs whenever the displayed value changes. The static
 
         ToDecimal method of the Convert class converts the 
         value back to its native Decimal type. */

      // Can only convert to decimal type.
      if(cevent.DesiredType != typeof(decimal)) return;

      cevent.Value = Decimal.Parse(cevent.Value.ToString(),
          NumberStyles.Currency, null);

      /* To see that no precision is lost, print the unformatted 
         value. For example, changing a value to "10.0001" 
         causes the control to display "10.00", but the 
         unformatted value remains "10.0001". */
      Console.WriteLine(cevent.Value);
   }

   private void button1_Click(object sender,
 System.EventArgs e)
   {
      // Go to the previous item in the Customer list.
      bmCustomers.Position -= 1;
   }

   private void button2_Click(object sender,
 System.EventArgs e)
   {
      // Go to the next item in the Customer list.
      bmCustomers.Position += 1;
   }
    
   private void button3_Click(object sender,
 System.EventArgs e)
   {
      // Go to the previous item in the Orders list.
      bmOrders.Position-=1;
   }

   private void button4_Click(object sender,
 System.EventArgs e)
   {
      // Go to the next item in the Orders list.
      bmOrders.Position+=1;
   }

   // Create a DataSet with two tables and populate it.
   private void MakeDataSet()
   {
      // Create a DataSet.
      ds = new DataSet("myDataSet");
      
      // Create two DataTables.
      DataTable tCust = new DataTable("Customers");
      DataTable tOrders = new DataTable("Orders");

      // Create two columns, and add them to the first table.
      DataColumn cCustID = new DataColumn("CustID",
 typeof(int));
      DataColumn cCustName = new DataColumn("CustName");
      tCust.Columns.Add(cCustID);
      tCust.Columns.Add(cCustName);

      // Create three columns, and add them to the second table.
      DataColumn cID = 
         new DataColumn("CustID", typeof(int));
      DataColumn cOrderDate = 
         new DataColumn("orderDate",typeof(DateTime));
      DataColumn cOrderAmount = 
         new DataColumn("OrderAmount", typeof(decimal));
      tOrders.Columns.Add(cOrderAmount);
      tOrders.Columns.Add(cID);
      tOrders.Columns.Add(cOrderDate);

      // Add the tables to the DataSet.
      ds.Tables.Add(tCust);
      ds.Tables.Add(tOrders);

      // Create a DataRelation, and add it to the DataSet.
      DataRelation dr = new DataRelation
      ("custToOrders", cCustID , cID);
      ds.Relations.Add(dr);
   
      /* Populate the tables. For each customer and order, 
         create two DataRow variables. */
      DataRow newRow1;
      DataRow newRow2;

      // Create three customers in the Customers Table.
      for(int i = 1; i < 4; i++)
      {
         newRow1 = tCust.NewRow();
         newRow1["custID"] = i;
         // Add the row to the Customers table.
         tCust.Rows.Add(newRow1);
      }
      // Give each customer a distinct name.
      tCust.Rows[0]["custName"] = "Alpha";
      tCust.Rows[1]["custName"] = "Beta";
      tCust.Rows[2]["custName"] = "Omega";
      
      // For each customer, create five rows in the Orders table.
      for(int i = 1; i < 4; i++)
      {
         for(int j = 1; j < 6; j++)
         {
            newRow2 = tOrders.NewRow();
            newRow2["CustID"]= i;
            newRow2["orderDate"]= new DateTime(2001,
 i, j * 2);
            newRow2["OrderAmount"] = i * 10 + j  * .1;
            // Add the row to the Orders table.
            tOrders.Rows.Add(newRow2);
         }
      }
   }
 }

#using <system.dll>
#using <system.data.dll>
#using <system.drawing.dll>
#using <system.windows.forms.dll>
#using <system.xml.dll>

using namespace System;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::Globalization;
using namespace System::Windows::Forms;

#define null 0L
public ref class Form1: public
 Form
{
private:
   System::ComponentModel::Container^ components;
   Button^ button1;
   Button^ button2;
   Button^ button3;
   Button^ button4;
   TextBox^ text1;
   TextBox^ text2;
   TextBox^ text3;
   BindingManagerBase^ bmCustomers;
   BindingManagerBase^ bmOrders;
   DataSet^ ds;
   DateTimePicker^ DateTimePicker1;

public:
   Form1()
   {
      // Required for Windows Form Designer support.
      InitializeComponent();

      // Call SetUp to bind the controls.
      SetUp();
   }

private:
   void InitializeComponent()
   {
      // Create the form and its controls.
      this->components = gcnew System::ComponentModel::Container;
      this->button1 = gcnew Button;
      this->button2 = gcnew Button;
      this->button3 = gcnew Button;
      this->button4 = gcnew Button;
      this->text1 = gcnew TextBox;
      this->text2 = gcnew TextBox;
      this->text3 = gcnew TextBox;
      this->DateTimePicker1 = gcnew DateTimePicker;
      this->Text =  "Binding Sample";
      this->ClientSize = System::Drawing::Size( 450, 200 );
      button1->Location = System::Drawing::Point( 24, 16 );
      button1->Size = System::Drawing::Size( 64, 24 );
      button1->Text =  "<";
      button1->Click += gcnew System::EventHandler( this, &Form1::button1_Click
 );
      button2->Location = System::Drawing::Point( 90, 16 );
      button2->Size = System::Drawing::Size( 64, 24 );
      button2->Text =  ">";
      button2->Click += gcnew System::EventHandler( this, &Form1::button2_Click
 );
      button3->Location = System::Drawing::Point( 90, 100 );
      button3->Size = System::Drawing::Size( 64, 24 );
      button3->Text =  "<";
      button3->Click += gcnew System::EventHandler( this, &Form1::button3_Click
 );
      button4->Location = System::Drawing::Point( 150, 100 );
      button4->Size = System::Drawing::Size( 64, 24 );
      button4->Text =  ">";
      button4->Click += gcnew System::EventHandler( this, &Form1::button4_Click
 );
      text1->Location = System::Drawing::Point( 24, 50 );
      text1->Size = System::Drawing::Size( 150, 24 );
      text2->Location = System::Drawing::Point( 190, 50 );
      text2->Size = System::Drawing::Size( 150, 24 );
      text3->Location = System::Drawing::Point( 290, 150 );
      text3->Size = System::Drawing::Size( 150, 24 );
      DateTimePicker1->Location = System::Drawing::Point( 90, 150 );
      DateTimePicker1->Size = System::Drawing::Size( 200, 800 );
      this->Controls->Add( button1 );
      this->Controls->Add( button2 );
      this->Controls->Add( button3 );
      this->Controls->Add( button4 );
      this->Controls->Add( text1 );
      this->Controls->Add( text2 );
      this->Controls->Add( text3 );
      this->Controls->Add( DateTimePicker1 );
   }

public:
   ~Form1()
   {
      if ( components != nullptr )
      {
         delete components;
      }
   }

private:
   void SetUp()
   {
      // Create a DataSet with two tables and one relation.
      MakeDataSet();
      BindControls();
   }

protected:
   void BindControls()
   {
      /* Create two Binding objects for the first two TextBox
 
              controls. The data-bound property for both controls
 
              is the Text property. The data source is a DataSet 
              (ds). The data member is the 
              "TableName.ColumnName" string. */
      text1->DataBindings->Add( gcnew Binding( "Text",ds,"customers.custName"
 ) );
      text2->DataBindings->Add( gcnew Binding( "Text",ds,"customers.custID"
 ) );

      /* Bind the DateTimePicker control by adding a new Binding.
 
              The data member of the DateTimePicker is a 
              TableName.RelationName.ColumnName string. */
      DateTimePicker1->DataBindings->Add( gcnew Binding( "Value",ds,"customers.CustToOrders.OrderDate"
 ) );

      /* Add event delegates for the Parse and Format events to
 a 
              new Binding object, and add the object to the third
 
              TextBox control's BindingsCollection. The delegates 
              must be added before adding the Binding to the 
              collection; otherwise, no formatting occurs until 
              the Current object of the BindingManagerBase for
 
              the data source changes. */
      Binding^ b = gcnew Binding( "Text",ds,"customers.custToOrders.OrderAmount"
 );
      b->Parse += gcnew ConvertEventHandler( this, &Form1::CurrencyStringToDecimal
 );
      b->Format += gcnew ConvertEventHandler( this, &Form1::DecimalToCurrencyString
 );
      text3->DataBindings->Add( b );

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

      /* Get the BindingManagerBase for the Orders table using
 the 
              RelationName. */
      bmOrders = this->BindingContext[ ds, "customers.CustToOrders"
 ];
   }

private:
   void DecimalToCurrencyString( Object^ /*sender*/, ConvertEventArgs^
 cevent )
   {
      /* This method is the Format event handler. Whenever the 
              control displays a new value, the value is converted
 from 
              its native Decimal type to a string. The ToString method
 
              then formats the value as a Currency, by using the
 
              formatting character "c". */
      // The application can only convert to string type. 
      if ( cevent->DesiredType != String::typeid )
            return;

      cevent->Value = (dynamic_cast<Decimal^>(cevent->Value))->ToString(
 "c" );
   }

   void CurrencyStringToDecimal( Object^ /*sender*/, ConvertEventArgs^
 cevent )
   {
      /* This method is the Parse event handler. The Parse event 
              occurs whenever the displayed value changes. The static
 
              ToDecimal method of the Convert class converts the
 
              value back to its native Decimal type. */
      // Can only convert to Decimal type.
      if ( cevent->DesiredType != Decimal::typeid )
            return;

      cevent->Value = Decimal::Parse( cevent->Value->ToString(), NumberStyles::Currency,
 nullptr );
      
      /* To see that no precision is lost, print the unformatted 
              value. For example, changing a value to "10.0001" 
              causes the control to display "10.00", but the 
              unformatted value remains "10.0001". */
      Console::WriteLine( cevent->Value );
   }

private:
   void button1_Click( Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      // Go to the previous item in the Customer list.
      bmCustomers->Position -= 1;
   }

   void button2_Click( Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      // Go to the next item in the Customer list.
      bmCustomers->Position += 1;
   }

   void button3_Click( Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      
      // Go to the previous item in the Orders list.
      bmOrders->Position = bmOrders->Position - 1;
   }

   void button4_Click( Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      
      // Go to the next item in the Orders list.
      bmOrders->Position = bmOrders->Position + 1;
   }

private:

   // Create a DataSet with two tables and populate it.
   void MakeDataSet()
   {
      // Create a DataSet.
      ds = gcnew DataSet( "myDataSet" );

      // Create two DataTables.
      DataTable^ tCust = gcnew DataTable( "Customers" );
      DataTable^ tOrders = gcnew DataTable( "Orders" );

      // Create two columns, and add them to the first table.
      DataColumn^ cCustID = gcnew DataColumn( "CustID",Int32::typeid );
      DataColumn^ cCustName = gcnew DataColumn( "CustName" );
      tCust->Columns->Add( cCustID );
      tCust->Columns->Add( cCustName );

      // Create three columns, and add them to the second table.
      DataColumn^ cID = gcnew DataColumn( "CustID",Int32::typeid );
      DataColumn^ cOrderDate = gcnew DataColumn( "orderDate",DateTime::typeid
 );
      DataColumn^ cOrderAmount = gcnew DataColumn( "OrderAmount",Decimal::typeid
 );
      tOrders->Columns->Add( cOrderAmount );
      tOrders->Columns->Add( cID );
      tOrders->Columns->Add( cOrderDate );

      // Add the tables to the DataSet.
      ds->Tables->Add( tCust );
      ds->Tables->Add( tOrders );

      // Create a DataRelation, and add it to the DataSet.
      DataRelation^ dr = gcnew DataRelation( "custToOrders",cCustID,cID
 );
      ds->Relations->Add( dr );
      
      /* Populate the tables. For each customer and order, 
              create two DataRow variables. */
      DataRow^ newRow1; // = new DataRow();

      DataRow^ newRow2; // = new DataRow();

      // Create three customers in the Customers Table.
      for ( int i = 1; i < 4; i++ )
      {
         newRow1 = tCust->NewRow();
         newRow1[ "custID" ] = i;
         
         // Add the row to the Customers table.
         tCust->Rows->Add( newRow1 );

      }
      tCust->Rows[ 0 ][ "custName" ] = "Alpha";
      tCust->Rows[ 1 ][ "custName" ] = "Beta";
      tCust->Rows[ 2 ][ "custName" ] = "Omega";
      
      // For each customer, create five rows in the Orders table.
      for ( int i = 1; i < 4; i++ )
      {
         for ( int j = 1; j < 6; j++ )
         {
            newRow2 = tOrders->NewRow();
            newRow2[ "CustID" ] = i;
            newRow2[ "orderDate" ] = System::DateTime( 2001, i, j * 2 );
            newRow2[ "OrderAmount" ] = i * 10 + j * .1;
            
            // Add the row to the Orders table.
            tOrders->Rows->Add( newRow2 );
         }
      }
   }
};

int main()
{
   Application::Run( gcnew Form1 );
}
import System.*;
import System.Data.*;
import System.Drawing.*;
import System.Globalization.*;
import System.Windows.Forms.*;

public class Form1 extends System.Windows.Forms.Form
{
    private System.ComponentModel.Container components;
    private Button button1;
    private Button button2;
    private Button button3;
    private Button button4;
    private TextBox text1;
    private TextBox text2;
    private TextBox text3;
    private BindingManagerBase bmCustomers;
    private BindingManagerBase bmOrders;
    private DataSet ds;
    private DateTimePicker dateTimePicker1;

    public Form1()
    {
        // Required for Windows Form Designer support.
        InitializeComponent();
        // Call SetUp to bind the controls.
        SetUp();
    } //Form1

    private void InitializeComponent()
    {
        // Create the form and its controls.
        this.components = new System.ComponentModel.Container();
        this.button1 = new System.Windows.Forms.Button();
        this.button2 = new System.Windows.Forms.Button();
        this.button3 = new System.Windows.Forms.Button();
        this.button4 = new System.Windows.Forms.Button();
        this.text1 = new System.Windows.Forms.TextBox();
        this.text2 = new System.Windows.Forms.TextBox();
        this.text3 = new System.Windows.Forms.TextBox();
        this.dateTimePicker1 = new DateTimePicker();
        this.set_Text("Binding Sample");
        this.set_ClientSize(new System.Drawing.Size(450,
 200));
        button1.set_Location(new System.Drawing.Point(24, 16));
        button1.set_Size(new System.Drawing.Size(64, 24));
        button1.set_Text("<");
        button1.add_Click(new System.EventHandler(button1_Click));
        button2.set_Location(new System.Drawing.Point(90, 16));
        button2.set_Size(new System.Drawing.Size(64, 24));
        button2.set_Text(">");
        button2.add_Click(new System.EventHandler(button2_Click));
        button3.set_Location(new System.Drawing.Point(90, 100));
        button3.set_Size(new System.Drawing.Size(64, 24));
        button3.set_Text("<");
        button3.add_Click(new System.EventHandler(button3_Click));
        button4.set_Location(new System.Drawing.Point(150, 100));
        button4.set_Size(new System.Drawing.Size(64, 24));
        button4.set_Text(">");
        button4.add_Click(new System.EventHandler(button4_Click));
        text1.set_Location(new System.Drawing.Point(24, 50));
        text1.set_Size(new System.Drawing.Size(150, 24));
        text2.set_Location(new System.Drawing.Point(190, 50));
        text2.set_Size(new System.Drawing.Size(150, 24));
        text3.set_Location(new System.Drawing.Point(290, 150));
        text3.set_Size(new System.Drawing.Size(150, 24));
        dateTimePicker1.set_Location(new System.Drawing.Point(90,
 150));
        dateTimePicker1.set_Size(new System.Drawing.Size(200,
 800));
        this.get_Controls().Add(button1);
        this.get_Controls().Add(button2);
        this.get_Controls().Add(button3);
        this.get_Controls().Add(button4);
        this.get_Controls().Add(text1);
        this.get_Controls().Add(text2);
        this.get_Controls().Add(text3);
        this.get_Controls().Add(dateTimePicker1);
    } //InitializeComponent

    protected void Dispose(boolean disposing)
    {
        if (disposing) {
            if (components != null) {
                components.Dispose();
            }
        }
        super.Dispose(disposing);
    } //Dispose

    public static void main(String[]
 args)
    {
        Application.Run(new Form1());
    } //main

    private void SetUp()
    {
        // Create a DataSet with two tables and one relation.
        MakeDataSet();
        BindControls();
    } //SetUp

    protected void BindControls()
    {
        /* Create two Binding objects for the first two TextBox
 
           controls. The data-bound property for both controls
 
           is the Text property. The data source is a DataSet 
           (ds). The data member is the  
           "TableName.ColumnName" string. 
         */
        text1.get_DataBindings().Add(new Binding("Text",
 ds, 
            "customers.custName"));
        text2.get_DataBindings().Add(new Binding("Text",
 ds, 
            "customers.custID"));

        /* Bind the DateTimePicker control by adding a new Binding.
 
           The data member of the DateTimePicker is a 
           TableName.RelationName.ColumnName string. 
         */
        dateTimePicker1.get_DataBindings().Add(new Binding("Value",
 ds, 
            "customers.CustToOrders.OrderDate"));

        /* Add event delegates for the Parse and Format events to
 a 
           new Binding object, and add the object to the third
 
           TextBox control's BindingsCollection. The delegates 
           must be added before adding the Binding to the 
           collection; otherwise, no formatting occurs until 
           the Current object of the BindingManagerBase for 
           the data source changes. 
         */
        Binding b = new Binding("Text", ds, 
            "customers.custToOrders.OrderAmount");

        b.add_Parse(new ConvertEventHandler(CurrencyStringToDecimal));
        b.add_Format(new ConvertEventHandler(DecimalToCurrencyString));
        text3.get_DataBindings().Add(b);

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

        /* Get the BindingManagerBase for the Orders table using
 the 
           RelationName. 
         */
        bmOrders = this.get_BindingContext().get_Item(ds, 
            "customers.CustToOrders");
    } //BindControls

    private void DecimalToCurrencyString(Object
 sender, ConvertEventArgs cevent)
    {
        /* This method is the Format event handler. Whenever the 
           control displays a new value, the value is converted
 from 
           its native Decimal type to a string. The ToString method
 
           then formats the value as a Currency, by using the
 
           formatting character "c". 
         */

        // The application can only convert to string type. 
        if (!cevent.get_DesiredType().Equals(String.class.ToType()))
 {
            return;
        }
        cevent.set_Value(((System.Decimal)(cevent.get_Value())).ToString("c"));
    } //DecimalToCurrencyString

    private void CurrencyStringToDecimal(Object
 sender, ConvertEventArgs cevent)
    {
        /* This method is the Parse event handler. The Parse event 
           occurs whenever the displayed value changes. The static
 
           ToDecimal method of the Convert class converts the
 
           value back to its native Decimal type. 
         */

        // Can only convert to decimal type.
        if (!cevent.get_DesiredType().Equals(System.Decimal.class.ToType()))
 {
            return;
        }
        cevent.set_Value(Decimal.Parse(cevent.get_Value().ToString(), 
            NumberStyles.Currency, null));

        /* To see that no precision is lost, print the unformatted 
           value. For example, changing a value to "10.0001" 
           causes the control to display "10.00", but the 
           unformatted value remains "10.0001". 
         */
        Console.WriteLine(cevent.get_Value());
    } //CurrencyStringToDecimal

    protected void button1_Click(Object sender,
 System.EventArgs e)
    {
        // Go to the previous item in the Customer list.
        bmCustomers.set_Position(bmCustomers.get_Position() - 1);
    } //button1_Click

    protected void button2_Click(Object sender,
 System.EventArgs e)
    {
        // Go to the next item in the Customer list.
        bmCustomers.set_Position(bmCustomers.get_Position() + 1);
    } //button2_Click

    protected void button3_Click(Object sender,
 System.EventArgs e)
    {
        // Go to the previous item in the Orders list.
        bmOrders.set_Position(bmOrders.get_Position() - 1);
    } //button3_Click

    protected void button4_Click(Object sender,
 System.EventArgs e)
    {
        // Go to the next item in the Orders list.
        bmOrders.set_Position(bmOrders.get_Position() + 1);
    } //button4_Click

    // Create a DataSet with two tables and populate it.
    private void MakeDataSet()
    {
        // Create a DataSet.
        ds = new DataSet("myDataSet");

        // Create two DataTables.
        DataTable tCust = new DataTable("Customers");
        DataTable tOrders = new DataTable("Orders");

        // Create two columns, and add them to the first table.
        DataColumn cCustID = new DataColumn("CustID",
 int.class.ToType());
        DataColumn cCustName = new DataColumn("CustName");

        tCust.get_Columns().Add(cCustID);
        tCust.get_Columns().Add(cCustName);

        // Create three columns, and add them to the second table.
        DataColumn cID = new DataColumn("CustID", int.class.ToType());
        DataColumn cOrderDate = new DataColumn("orderDate",
 
            DateTime.class.ToType());
        DataColumn cOrderAmount = new DataColumn("OrderAmount",
 
            System.Decimal.class.ToType());

        tOrders.get_Columns().Add(cOrderAmount);
        tOrders.get_Columns().Add(cID);
        tOrders.get_Columns().Add(cOrderDate);

        // Add the tables to the DataSet.
        ds.get_Tables().Add(tCust);
        ds.get_Tables().Add(tOrders);

        // Create a DataRelation, and add it to the DataSet.
        DataRelation dr = new DataRelation("custToOrders",
 cCustID, cID);
        ds.get_Relations().Add(dr);

        /* Populate the tables. For each customer and order, 
           create two DataRow variables. 
         */
        DataRow newRow1;
        DataRow newRow2;

        // Create three customers in the Customers Table.
        for (int i = 1; i < 4; i++) {
            newRow1 = tCust.NewRow();
            newRow1.set_Item("custID", (Int32)i);
            // Add the row to the Customers table.
            tCust.get_Rows().Add(newRow1);
        }

        // Give each customer a distinct name.
        tCust.get_Rows().get_Item(0).set_Item("custName", "Alpha");
        tCust.get_Rows().get_Item(1).set_Item("custName", "Beta");
        tCust.get_Rows().get_Item(2).set_Item("custName", "Omega");

        // For each customer, create five rows in the Orders table.
        for (int i = 1; i < 4; i++) {
            for (int j = 1; j < 6; j++)
 {
                newRow2 = tOrders.NewRow();
                newRow2.set_Item("CustID", (Int32)i);
                newRow2.set_Item("orderDate", new DateTime(2001,
 i, j * 2));
                newRow2.set_Item("OrderAmount",    
                    (System.Double)(i * 10 + j * 0.1));
                // Add the row to the Orders table.
                tOrders.get_Rows().Add(newRow2);
            }
        }
    } //MakeDataSet
} //Form1
import System;
import System.Data;
import System.Drawing;
import System.Globalization;
import System.Windows.Forms;

public class Form1 extends
 System.Windows.Forms.Form
{
   private var components : System.ComponentModel.Container;
   private var button1 : Button;
   private var button2 : Button;
   private var button3 : Button;
   private var button4 : Button;
   private var text1 : TextBox;
   private var text2 : TextBox;
   private var text3 : TextBox;

   private var bmCustomers : BindingManagerBase;
   private var bmOrders : BindingManagerBase;
   private var ds : DataSet;
   private var DateTimePicker1 : DateTimePicker;

   public function Form1()
   {
      // Required for Windows Form Designer support.
      InitializeComponent();
      // Call SetUp to bind the controls.
      SetUp();
   }
 
   private function InitializeComponent()
   {
      // Create the form and its controls.
      this.components = new System.ComponentModel.Container();
      this.button1 = new System.Windows.Forms.Button();
      this.button2 = new System.Windows.Forms.Button();
      this.button3 = new System.Windows.Forms.Button();
      this.button4 = new System.Windows.Forms.Button();
      
      this.text1= new System.Windows.Forms.TextBox();
      this.text2= new System.Windows.Forms.TextBox();
      this.text3= new System.Windows.Forms.TextBox();
      
      this.DateTimePicker1 = new DateTimePicker();
      
      this.Text = "Binding Sample";
      this.ClientSize = new System.Drawing.Size(450,
 200);
      
      button1.Location = new System.Drawing.Point(24, 16);
      button1.Size = new System.Drawing.Size(64, 24);
      button1.Text = "<";
      button1.add_Click(button1_Click);

      button2.Location = new System.Drawing.Point(90, 16);
      button2.Size = new System.Drawing.Size(64, 24);
      button2.Text = ">";
      button2.add_Click(button2_Click);

      button3.Location = new System.Drawing.Point(90, 100);
      button3.Size = new System.Drawing.Size(64, 24);
      button3.Text = "<";
      button3.add_Click(button3_Click);

      button4.Location = new System.Drawing.Point(150, 100);
      button4.Size = new System.Drawing.Size(64, 24);
      button4.Text = ">";
      button4.add_Click(button4_Click);

      text1.Location = new System.Drawing.Point(24, 50);
      text1.Size = new System.Drawing.Size(150, 24);

      text2.Location = new System.Drawing.Point(190, 50);
      text2.Size = new System.Drawing.Size(150, 24);

      text3.Location = new System.Drawing.Point(290, 150);
      text3.Size = new System.Drawing.Size(150, 24);
      
      DateTimePicker1.Location = new System.Drawing.Point(90,
 150);
      DateTimePicker1.Size = new System.Drawing.Size(200, 800);
      
      this.Controls.Add(button1);
      this.Controls.Add(button2);
      this.Controls.Add(button3);
      this.Controls.Add(button4);
      this.Controls.Add(text1);
      this.Controls.Add(text2);
      this.Controls.Add(text3);
      this.Controls.Add(DateTimePicker1);
   }

   protected override function Dispose(disposing
 : boolean){
      if( disposing ){
         if (components != null){
            components.Dispose();}
      }
      super.Dispose( disposing );
   }

   public static function
 Main()
   {
      Application.Run(new Form1());
   }
   
   private function SetUp()
   {
      // Create a DataSet with two tables and one relation.
      MakeDataSet();
      BindControls();
   }

   protected function BindControls()
   {
      /* Create two Binding objects for the first two TextBox
 
         controls. The data-bound property for both controls 
         is the Text property. The data source is a DataSet 
         (ds). The data member is the  
         "TableName.ColumnName" string. */
      text1.DataBindings.Add(new Binding
      ("Text", ds, "customers.custName"));
      text2.DataBindings.Add(new Binding
      ("Text", ds, "customers.custID"));
      
      /* Bind the DateTimePicker control by adding a new Binding.
 
         The data member of the DateTimePicker is a 
         TableName.RelationName.ColumnName string. */
      DateTimePicker1.DataBindings.Add(new 
      Binding("Value", ds, "customers.CustToOrders.OrderDate"));

      /* Add event delegates for the Parse and Format events to
 a 
         new Binding object, and add the object to the third 
         TextBox control's BindingsCollection. The delegates 
         must be added before adding the Binding to the 
         collection; otherwise, no formatting occurs until 
         the Current object of the BindingManagerBase for 
         the data source changes. */
      var b : Binding = new Binding
         ("Text", ds, "customers.custToOrders.OrderAmount");
      b.add_Parse(CurrencyStringToDecimal);
      b.add_Format(DecimalToCurrencyString);
      text3.DataBindings.Add(b);

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

      /* Get the BindingManagerBase for the Orders table using
 the 
         RelationName. */ 
      bmOrders = this.BindingContext[ds, "customers.CustToOrders"];
   }

   private function DecimalToCurrencyString(sender,
 cevent : ConvertEventArgs)
   {
      /* This method is the Format event handler. Whenever the 
         control displays a new value, the value is converted
 from 
         its native Decimal type to a string. The ToString method
 
         then formats the value as a Currency, by using the 
         formatting character "c". */

      // The application can only convert to string type. 
      if(cevent.DesiredType != String.GetType()) return;

      cevent.Value = (Decimal(cevent.Value)).ToString("c");
   }

   private function CurrencyStringToDecimal(sender,
 cevent : ConvertEventArgs)
   {   
      /* This method is the Parse event handler. The Parse event 
         occurs whenever the displayed value changes. The static
 
         ToDecimal method of the Convert class converts the 
         value back to its native Decimal type. */

      // Can only convert to Decimal type.
      if(cevent.DesiredType != Decimal.GetType()) return;

      cevent.Value = Decimal.Parse(cevent.Value.ToString(),
          NumberStyles.Currency, null);

      /* To see that no precision is lost, print the unformatted 
         value. For example, changing a value to "10.0001" 
         causes the control to display "10.00", but the 
         unformatted value remains "10.0001". */
      Console.WriteLine(cevent.Value);
   }

   protected function button1_Click(sender,
 e : System.EventArgs)
   {
      // Go to the previous item in the Customer list.
      bmCustomers.Position -= 1;
   }

   protected function button2_Click(sender,
 e : System.EventArgs)
   {
      // Go to the next item in the Customer list.
      bmCustomers.Position += 1;
   }
    
   protected function button3_Click(sender,
 e : System.EventArgs)
   {
      // Go to the previous item in the Orders list.
      bmOrders.Position-=1;
   }

   protected function button4_Click(sender,
 e : System.EventArgs)
   {
      // Go to the next item in the Orders list.
      bmOrders.Position+=1;
   }

   // Create a DataSet with two tables and populate it.
   private function MakeDataSet()
   {
      // Create a DataSet.
      ds = new DataSet("myDataSet");
      
      // Create two DataTables.
      var tCust : DataTable = new DataTable("Customers");
      var tOrders : DataTable= new DataTable("Orders");

      // Create two columns, and add them to the first table.
      var cCustID : DataColumn = new DataColumn("CustID",
 Int32);
      var cCustName : DataColumn = new DataColumn("CustName");
      tCust.Columns.Add(cCustID);
      tCust.Columns.Add(cCustName);

      // Create three columns, and add them to the second table.
      var cID : DataColumn  = 
         new DataColumn("CustID", Int32);
      var cOrderDate : DataColumn  = 
         new DataColumn("orderDate", DateTime);
      var cOrderAmount : DataColumn = 
         new DataColumn("OrderAmount", Decimal);
      tOrders.Columns.Add(cOrderAmount);
      tOrders.Columns.Add(cID);
      tOrders.Columns.Add(cOrderDate);

      // Add the tables to the DataSet.
      ds.Tables.Add(tCust);
      ds.Tables.Add(tOrders);

      // Create a DataRelation, and add it to the DataSet.
      var dr : DataRelation = new DataRelation
      ("custToOrders", cCustID , cID);
      ds.Relations.Add(dr);
   
      /* Populate the tables. For each customer and order, 
         create two DataRow variables. */
      var newRow1 : DataRow;
      var newRow2 : DataRow;

      // Create three customers in the Customers Table.
      for(var i : int =
 1; i < 4; i++)
      {
         newRow1 = tCust.NewRow();
         newRow1["custID"] = i;
         // Add the row to the Customers table.
         tCust.Rows.Add(newRow1);
      }
      // Give each customer a distinct name.
      tCust.Rows[0]["custName"] = "Alpha";
      tCust.Rows[1]["custName"] = "Beta";
      tCust.Rows[2]["custName"] = "Omega";
      
      // For each customer, create five rows in the Orders table.
      for(var j : int =
 1; j < 4; j++)
      {
         for(var k : int
 = 1; k < 6; k++)
         {
            newRow2 = tOrders.NewRow();
            newRow2["CustID"]= j;
            newRow2["orderDate"]= new DateTime(2001,
 j, k * 2);
            newRow2["OrderAmount"] = j * 10 + k  * .1;
            // Add the row to the Orders table.
            tOrders.Rows.Add(newRow2);
         }
      }
   }
 }

継承階層継承階層
System.Object
  System.Windows.Forms.Binding
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Binding メンバ
System.Windows.Forms 名前空間
BindingContext
BindingManagerBase
ComboBox
DataGrid

Binding コンストラクタ (String, Object, String, Boolean)

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

データ ソースの指定したデータ メンバに、指定したコントロール プロパティをバインドし、オプションで書式設定を適用できるようにする、Binding クラスの新しいインスタンスを初期化します。

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

Public Sub New ( _
    propertyName As String, _
    dataSource As Object, _
    dataMember As String, _
    formattingEnabled As Boolean _
)
Dim propertyName As String
Dim dataSource As Object
Dim dataMember As String
Dim formattingEnabled As Boolean

Dim instance As New Binding(propertyName,
 dataSource, dataMember, formattingEnabled)
public Binding (
    string propertyName,
    Object dataSource,
    string dataMember,
    bool formattingEnabled
)
public:
Binding (
    String^ propertyName, 
    Object^ dataSource, 
    String^ dataMember, 
    bool formattingEnabled
)
public Binding (
    String propertyName, 
    Object dataSource, 
    String dataMember, 
    boolean formattingEnabled
)
public function Binding (
    propertyName : String, 
    dataSource : Object, 
    dataMember : String, 
    formattingEnabled : boolean
)

パラメータ

propertyName

バインドするコントロール プロパティの名前。

dataSource

データ ソースを表す Object。

dataMember

バインド先のプロパティまたはリスト。

formattingEnabled

表示されるデータの書式を指定する場合は true。それ以外の場合は false。

例外例外
例外の種類条件

ArgumentException

propertyName で指定されたプロパティがコントロールにありません。

または

指定されたプロパティは読み取り専用です。

Exception

書式が無効である場合、propertyName は、コントロールの有効なプロパティでも、空の文字列 ("") でもありません。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Binding コンストラクタ (String, Object, String)

データ ソースの指定したデータ メンバに、指定したコントロール プロパティを単純バインドする、Binding クラスの新しいインスタンスを初期化します。

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

Public Sub New ( _
    propertyName As String, _
    dataSource As Object, _
    dataMember As String _
)
Dim propertyName As String
Dim dataSource As Object
Dim dataMember As String

Dim instance As New Binding(propertyName,
 dataSource, dataMember)
public Binding (
    string propertyName,
    Object dataSource,
    string dataMember
)
public:
Binding (
    String^ propertyName, 
    Object^ dataSource, 
    String^ dataMember
)
public Binding (
    String propertyName, 
    Object dataSource, 
    String dataMember
)
public function Binding (
    propertyName : String, 
    dataSource : Object, 
    dataMember : String
)

パラメータ

propertyName

バインドするコントロール プロパティの名前。

dataSource

データ ソースを表す Object。

dataMember

バインド先のプロパティまたはリスト。

例外例外
例外の種類条件

Exception

propertyName が、コントロールの有効なプロパティでも、空の文字列 ("") でもありません。

ArgumentException

propertyName で指定されたプロパティがコントロールにありません。

解説解説

データ ソースとして、次のいずれかのクラスのインスタンスを指定できます。

dataMember 文字列の作成方法については、Binding クラスのトピックを参照してください。

コントロールのプロパティに対するバインディングを作成すると、新しい Binding は、バインド先のコントロールによって公開されるイベントを検査し、2 つのイベントに結び付けます。

  • Control.Validating

  • PropertyName Changed という名前のイベント (Control.BackColorChanged など)。

存在しないプロパティにバインドしようとすると、Binding がコントロールの Control.DataBindings コレクションに追加されるときに ArgumentException がスローされます。

使用例使用例

myDataSet という名前の DataSet 内のテーブルの列に、TextBox コントロールをバインドするコード例を次に示します。この例では、モジュールの宣言セクションで myDataSet を宣言していることを前提にしています。

Private Sub CreateDataSet
   myDataSet = new DataSet("myDataSet")
   ' Populates the DataSet with tables, relations, and
   ' constraints.
End Sub

Private Sub BindTextBoxToDataSet 
   ' Binds a TextBox control to a column in the DataSet.
   textBox1.DataBindings.Add _
   ("Text", myDataSet, "Suppliers.CompanyName")
End Sub
private void CreateDataSet()
{
   myDataSet = new DataSet("myDataSet");
   /* Populates the DataSet with tables, relations, and 
      constraints. */
}

private void BindTextBoxToDataSet()
{
   /* Binds a TextBox control to a DataColumn named
   CompanyName in the DataTable named Suppliers. */
   textBox1.DataBindings.Add
   ("Text", myDataSet, "Suppliers.CompanyName");
}
   
private:
   void CreateDataSet()
   {
      myDataSet = gcnew DataSet( "myDataSet" );
      /* Populates the DataSet with tables, relations, and 
         constraints. */
   }

   void BindTextBoxToDataSet()
   {
      /* Binds a TextBox control to a DataColumn named
      CompanyName in the DataTable named Suppliers. */
      textBox1->DataBindings->Add(
         "Text", myDataSet, "Suppliers.CompanyName" );
   }
private void CreateDataSet()
{
    myDataSet = new DataSet("myDataSet");
} //CreateDataSet

/* Populates the DataSet with tables, relations, and 
   constraints. 
 */
private void BindTextBoxToDataSet()
{
    /* Binds a TextBox control to a DataColumn named
       CompanyName in the DataTable named Suppliers. 
     */
    textBox1.get_DataBindings().Add("Text", myDataSet, 
        "Suppliers.CompanyName");
} //BindTextBoxToDataSet
private function CreateDataSet()
{
   myDataSet = new DataSet("myDataSet");
      
   // Creates a DataTable
   var myDataTable : DataTable = new DataTable("Suppliers");

   // Creates two columns, 
   var id : DataColumn = new DataColumn("ID",
 int);
   var name : DataColumn = new DataColumn("CompanyName",
 System.String);
   myDataTable.Columns.Add(id);
   myDataTable.Columns.Add(name);

   // Adds the table to the DataSet.
   myDataSet.Tables.Add(myDataTable);

   // Creates three suppliers in the Suppliers Table.
   var dr : DataRow;

   for(var i : int = 1;
 i < 4; i++)
   {
     dr = myDataTable.NewRow();
     dr[0] = i;
     dr[1] = "Company " + i.ToString();

     myDataTable.Rows.Add(dr);
   }   
}

private function BindTextBoxToDataSet()
{
   /* Binds a TextBox control to a DataColumn named
   CompanyName in the DataTable named Suppliers. */
   textBox1.DataBindings.Add
   (new Binding("Text", myDataSet, "Suppliers.CompanyName"));
}
   
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Binding クラス
Binding メンバ
System.Windows.Forms 名前空間
BindingsCollection
CurrencyManager

Binding コンストラクタ (String, Object, String, Boolean, DataSourceUpdateMode)

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

指定したデータ ソースの指定したデータ メンバに、指定したコントロール プロパティをバインドする、Binding クラスの新しいインスタンスを初期化します。オプションで書式を有効にしたり、特定の更新設定に基づいてデータ ソースに値を反映したりできます。

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

Public Sub New ( _
    propertyName As String, _
    dataSource As Object, _
    dataMember As String, _
    formattingEnabled As Boolean, _
    dataSourceUpdateMode As DataSourceUpdateMode _
)
Dim propertyName As String
Dim dataSource As Object
Dim dataMember As String
Dim formattingEnabled As Boolean
Dim dataSourceUpdateMode As DataSourceUpdateMode

Dim instance As New Binding(propertyName,
 dataSource, dataMember, formattingEnabled, dataSourceUpdateMode)
public Binding (
    string propertyName,
    Object dataSource,
    string dataMember,
    bool formattingEnabled,
    DataSourceUpdateMode dataSourceUpdateMode
)
public:
Binding (
    String^ propertyName, 
    Object^ dataSource, 
    String^ dataMember, 
    bool formattingEnabled, 
    DataSourceUpdateMode dataSourceUpdateMode
)
public Binding (
    String propertyName, 
    Object dataSource, 
    String dataMember, 
    boolean formattingEnabled, 
    DataSourceUpdateMode dataSourceUpdateMode
)
public function Binding (
    propertyName : String, 
    dataSource : Object, 
    dataMember : String, 
    formattingEnabled : boolean, 
    dataSourceUpdateMode : DataSourceUpdateMode
)

パラメータ

propertyName

バインドするコントロール プロパティの名前。

dataSource

データ ソースを表す Object。

dataMember

バインド先のプロパティまたはリスト。

formattingEnabled

表示されるデータの書式を指定する場合は true。それ以外の場合は false。

dataSourceUpdateMode

DataSourceUpdateMode 値の 1 つ。

例外例外
解説解説

データ ソースとして、次のいずれかのクラスのインスタンスを指定できます。

dataMember 文字列の作成方法については、Binding クラスのトピックを参照してください。

コントロールのプロパティに対するバインディングを作成すると、新しい Binding は、バインド先のコントロールによって公開されるイベントを検査し、2 つのイベントに結び付けます。

  • Control.Validating.

  • PropertyName Changed という名前のイベント (Control.BackColorChanged など)。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Binding コンストラクタ (String, Object, String, Boolean, DataSourceUpdateMode, Object)

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

指定したデータ ソースの指定したデータ メンバに、指定したコントロール プロパティをバインドする Binding クラスの新しいインスタンスを初期化します。オプションで書式を有効にしたり、特定の更新設定に基づいてデータ ソースに値を反映したりできる以外に、データ ソースから DBNull が返された場合に使用されるプロパティ値を指定することもできます。

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

Public Sub New ( _
    propertyName As String, _
    dataSource As Object, _
    dataMember As String, _
    formattingEnabled As Boolean, _
    dataSourceUpdateMode As DataSourceUpdateMode, _
    nullValue As Object _
)
Dim propertyName As String
Dim dataSource As Object
Dim dataMember As String
Dim formattingEnabled As Boolean
Dim dataSourceUpdateMode As DataSourceUpdateMode
Dim nullValue As Object

Dim instance As New Binding(propertyName,
 dataSource, dataMember, formattingEnabled, dataSourceUpdateMode, nullValue)
public Binding (
    string propertyName,
    Object dataSource,
    string dataMember,
    bool formattingEnabled,
    DataSourceUpdateMode dataSourceUpdateMode,
    Object nullValue
)
public:
Binding (
    String^ propertyName, 
    Object^ dataSource, 
    String^ dataMember, 
    bool formattingEnabled, 
    DataSourceUpdateMode dataSourceUpdateMode, 
    Object^ nullValue
)
public Binding (
    String propertyName, 
    Object dataSource, 
    String dataMember, 
    boolean formattingEnabled, 
    DataSourceUpdateMode dataSourceUpdateMode, 
    Object nullValue
)
public function Binding (
    propertyName : String, 
    dataSource : Object, 
    dataMember : String, 
    formattingEnabled : boolean, 
    dataSourceUpdateMode : DataSourceUpdateMode, 
    nullValue : Object
)

パラメータ

propertyName

バインドするコントロール プロパティの名前。

dataSource

データ ソースを表す Object。

dataMember

バインド先のプロパティまたはリスト。

formattingEnabled

表示されるデータの書式を指定する場合は true。それ以外の場合は false。

dataSourceUpdateMode

DataSourceUpdateMode 値の 1 つ。

nullValue

データ ソースの値が DBNull である場合にバインドされたコントロールのプロパティに適用される Object。

例外例外
解説解説

データ ソースとして、次のいずれかのクラスのインスタンスを指定できます。

dataMember 文字列の作成方法については、Binding クラスのトピックを参照してください。

コントロールのプロパティに対するバインディングを作成すると、新しい Binding は、バインド先のコントロールによって公開されるイベントを検査し、2 つのイベントに結び付けます。

  • Control.Validating

  • PropertyName Changed という名前のイベント (Control.BackColorChanged など)。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Binding コンストラクタ (String, Object, String, Boolean, DataSourceUpdateMode, Object, String)

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

指定したデータ ソースの指定したデータ メンバに、指定したコントロール プロパティをバインドする、Binding クラスの新しいインスタンスを初期化します。オプションで、指定した書式指定文字列で書式を有効にしたり、特定の更新設定に基づいてデータ ソースに値を反映したりできる以外に、データ ソースから DBNull が返された場合に使用されるプロパティ値を指定したり、書式プロバイダを指定することもできます。

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

Public Sub New ( _
    propertyName As String, _
    dataSource As Object, _
    dataMember As String, _
    formattingEnabled As Boolean, _
    dataSourceUpdateMode As DataSourceUpdateMode, _
    nullValue As Object, _
    formatString As String _
)
Dim propertyName As String
Dim dataSource As Object
Dim dataMember As String
Dim formattingEnabled As Boolean
Dim dataSourceUpdateMode As DataSourceUpdateMode
Dim nullValue As Object
Dim formatString As String

Dim instance As New Binding(propertyName,
 dataSource, dataMember, formattingEnabled, dataSourceUpdateMode, nullValue, formatString)
public Binding (
    string propertyName,
    Object dataSource,
    string dataMember,
    bool formattingEnabled,
    DataSourceUpdateMode dataSourceUpdateMode,
    Object nullValue,
    string formatString
)
public:
Binding (
    String^ propertyName, 
    Object^ dataSource, 
    String^ dataMember, 
    bool formattingEnabled, 
    DataSourceUpdateMode dataSourceUpdateMode, 
    Object^ nullValue, 
    String^ formatString
)
public Binding (
    String propertyName, 
    Object dataSource, 
    String dataMember, 
    boolean formattingEnabled, 
    DataSourceUpdateMode dataSourceUpdateMode, 
    Object nullValue, 
    String formatString
)
public function Binding (
    propertyName : String, 
    dataSource : Object, 
    dataMember : String, 
    formattingEnabled : boolean, 
    dataSourceUpdateMode : DataSourceUpdateMode, 
    nullValue : Object, 
    formatString : String
)

パラメータ

propertyName

バインドするコントロール プロパティの名前。

dataSource

データ ソースを表す Object。

dataMember

バインド先のプロパティまたはリスト。

formattingEnabled

表示されるデータの書式を指定する場合は true。それ以外の場合は false。

dataSourceUpdateMode

DataSourceUpdateMode 値の 1 つ。

nullValue

データ ソースの値が DBNull である場合にバインドされたコントロールのプロパティに適用される Object。

formatString

値の表示方法を示す 1 つ以上の書式指定子文字。

例外例外
解説解説

データ ソースとして、次のいずれかのクラスのインスタンスを指定できます。

dataMember 文字列の作成方法については、Binding クラスのトピックを参照してください。

コントロールのプロパティに対するバインディングを作成すると、新しい Binding は、バインド先のコントロールによって公開されるイベントを検査し、2 つのイベントに結び付けます。

  • Control.Validating

  • PropertyName Changed という名前のイベント (Control.BackColorChanged など)。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Binding コンストラクタ (String, Object, String, Boolean, DataSourceUpdateMode, Object, String, IFormatProvider)

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

指定したデータ ソースの指定したデータ メンバに、指定したコントロール プロパティをバインドする、Binding クラスの新しいインスタンスを初期化します。オプションで、指定した書式指定文字列で書式を有効にしたり、特定の更新設定に基づいてデータ ソースに値を反映したりできる以外に、データ ソースから DBNull が返された場合に使用されるプロパティ値を指定したり、書式プロバイダを指定することもできます。

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

Public Sub New ( _
    propertyName As String, _
    dataSource As Object, _
    dataMember As String, _
    formattingEnabled As Boolean, _
    dataSourceUpdateMode As DataSourceUpdateMode, _
    nullValue As Object, _
    formatString As String, _
    formatInfo As IFormatProvider _
)
Dim propertyName As String
Dim dataSource As Object
Dim dataMember As String
Dim formattingEnabled As Boolean
Dim dataSourceUpdateMode As DataSourceUpdateMode
Dim nullValue As Object
Dim formatString As String
Dim formatInfo As IFormatProvider

Dim instance As New Binding(propertyName,
 dataSource, dataMember, formattingEnabled, dataSourceUpdateMode, nullValue, formatString,
 formatInfo)
public Binding (
    string propertyName,
    Object dataSource,
    string dataMember,
    bool formattingEnabled,
    DataSourceUpdateMode dataSourceUpdateMode,
    Object nullValue,
    string formatString,
    IFormatProvider formatInfo
)
public:
Binding (
    String^ propertyName, 
    Object^ dataSource, 
    String^ dataMember, 
    bool formattingEnabled, 
    DataSourceUpdateMode dataSourceUpdateMode, 
    Object^ nullValue, 
    String^ formatString, 
    IFormatProvider^ formatInfo
)
public Binding (
    String propertyName, 
    Object dataSource, 
    String dataMember, 
    boolean formattingEnabled, 
    DataSourceUpdateMode dataSourceUpdateMode, 
    Object nullValue, 
    String formatString, 
    IFormatProvider formatInfo
)
public function Binding (
    propertyName : String, 
    dataSource : Object, 
    dataMember : String, 
    formattingEnabled : boolean, 
    dataSourceUpdateMode : DataSourceUpdateMode, 
    nullValue : Object, 
    formatString : String, 
    formatInfo : IFormatProvider
)

パラメータ

propertyName

バインドするコントロール プロパティの名前。

dataSource

データ ソースを表す Object。

dataMember

バインド先のプロパティまたはリスト。

formattingEnabled

表示されるデータの書式を指定する場合は true。それ以外の場合は false。

dataSourceUpdateMode

DataSourceUpdateMode 値の 1 つ。

nullValue

データ ソースの値が DBNull である場合にバインドされたコントロールのプロパティに適用される Object。

formatString

値の表示方法を示す 1 つ以上の書式指定子文字。

formatInfo

既定の書式指定動作をオーバーライドする IFormatProvider の実装。

例外例外
解説解説

データ ソースとして、次のいずれかのクラスのインスタンスを指定できます。

dataMember 文字列の作成方法については、Binding クラスのトピックを参照してください。

コントロールのプロパティに対するバインディングを作成すると、新しい Binding は、バインド先のコントロールによって公開されるイベントを検査し、2 つのイベントに結び付けます。

  • Control.Validating

  • PropertyName Changed という名前のイベント (Control.BackColorChanged など)。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Binding コンストラクタ


Binding コンストラクタ

Binding クラスの新しいインスタンスを初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
Binding (String, Object, String) データ ソースの指定したデータ メンバに、指定したコントロール プロパティを単純バインドする、Binding クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

Binding (String, Object, String, Boolean) データ ソースの指定したデータ メンバに、指定したコントロール プロパティをバインドし、オプションで書式設定を適用できるようにする、Binding クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

Binding (String, Object, String, Boolean, DataSourceUpdateMode) 指定したデータ ソースの指定したデータ メンバに、指定したコントロール プロパティをバインドする、Binding クラスの新しいインスタンスを初期化します。オプションで書式を有効にしたり、特定の更新設定に基づいてデータ ソースに値を反映したりできます。

.NET Compact Framework によってサポートされています。

Binding (String, Object, String, Boolean, DataSourceUpdateMode, Object) 指定したデータ ソースの指定したデータ メンバに、指定したコントロール プロパティをバインドする Binding クラスの新しいインスタンスを初期化します。オプションで書式を有効にしたり、特定の更新設定に基づいてデータ ソースに値を反映したりできる以外に、データ ソースから DBNull が返された場合に使用されるプロパティ値を指定することもできます。

.NET Compact Framework によってサポートされています。

Binding (String, Object, String, Boolean, DataSourceUpdateMode, Object, String) 指定したデータ ソースの指定したデータ メンバに、指定したコントロール プロパティをバインドする、Binding クラスの新しいインスタンスを初期化します。オプションで、指定した書式指定文字列で書式を有効にしたり、特定の更新設定に基づいてデータ ソースに値を反映したりできる以外に、データ ソースから DBNull が返された場合に使用されるプロパティ値を指定したり、書式プロバイダを指定することもできます。

.NET Compact Framework によってサポートされています。

Binding (String, Object, String, Boolean, DataSourceUpdateMode, Object, String, IFormatProvider) 指定したデータ ソースの指定したデータ メンバに、指定したコントロール プロパティをバインドする、Binding クラスの新しいインスタンスを初期化します。オプションで、指定した書式指定文字列で書式を有効にしたり、特定の更新設定に基づいてデータ ソースに値を反映したりできる以外に、データ ソースから DBNull が返された場合に使用されるプロパティ値を指定したり、書式プロバイダを指定することもできます。

.NET Compact Framework によってサポートされています。

参照参照

関連項目

Binding クラス
Binding メンバ
System.Windows.Forms 名前空間
BindingsCollection
CurrencyManager

Binding フィールド


プロテクト フィールドプロテクト フィールド

  名前 説明
プロテクト フィールド defaultMember  
プロテクト フィールド isAssignmentToDefaultIndexedProperty  
プロテクト フィールド isFullyResolved  
プロテクト フィールド isNonVirtual  
プロテクト フィールド name  
参照参照

Binding プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ Documentation  DocumentableItem のインスタンスのテキスト ドキュメントを取得または設定します。 ( DocumentableItem から継承されます。)
パブリック プロパティ DocumentationElement  DocumentableItem のドキュメント要素を取得または設定します。 ( DocumentableItem から継承されます。)
パブリック プロパティ ExtensibleAttributes  Web Services Interoperability (WS-I) Basic Profile 1.1 に準拠する WSDL の属性の拡張機能を表す XmlAttribute 型の配列を取得または設定します。 ( DocumentableItem から継承されます。)
パブリック プロパティ Extensions オーバーライドされます。 XML Web サービスで使用する機能拡張要素のコレクションを取得します。
パブリック プロパティ Name  項目の名前を取得または設定します。 ( NamedItem から継承されます。)
パブリック プロパティ Namespaces  ServiceDescription オブジェクトが生成されるときに名前空間プレフィックスと名前空間を保持するために使用する、名前空間プレフィックスと名前空間のディクショナリを取得または設定します。 ( DocumentableItem から継承されます。)
パブリック プロパティ Operations XML Web サービスでサポートされているアクションで使用する、データ形式およびメッセージ プロトコルの仕様のコレクションを取得します。
パブリック プロパティ ServiceDescription Binding がメンバとして含まれている ServiceDescription を取得します。
パブリック プロパティ Type Binding に関連付けられている PortType の名前空間限定名を表す値を取得または設定します。
参照参照

関連項目

Binding クラス
System.Web.Services.Description 名前空間

Binding プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ PropertyName コントロールのデータ連結プロパティの名前を取得または設定します。
参照参照

関連項目

Binding クラス
System.Windows.Forms 名前空間
BindingContext
BindingManagerBase
ComboBox
DataGrid

Binding メソッド


Binding メソッド


Binding メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

Binding クラス
System.Windows.Forms 名前空間
BindingContext
BindingManagerBase
ComboBox
DataGrid

Binding メンバ

Binding データ型で公開されるメンバを以下の表に示します。


プロテクト フィールドプロテクト フィールド
  名前 説明
プロテクト フィールド defaultMember  
プロテクト フィールド isAssignmentToDefaultIndexedProperty  
プロテクト フィールド isFullyResolved  
プロテクト フィールド isNonVirtual  
プロテクト フィールド name  
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド Finalize  Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。)
プロテクト メソッド GetObject  
プロテクト メソッド HandleNoSuchMemberError  
プロテクト メソッド MemberwiseClone  現在の Object の簡易コピーを作成します。 (Object から継承されます。)
プロテクト メソッド ResolveRHValue  
プロテクト メソッド TranslateToILObject  
プロテクト メソッド TranslateToILWithDupOfThisOb  
参照参照

Binding メンバ

XML Web サービスで使用される具象データの形式およびプロトコルを指定します。このクラスは継承できません。

Binding データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド Binding  
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ Documentation  DocumentableItem のインスタンスのテキスト ドキュメントを取得または設定します。(DocumentableItem から継承されます。)
パブリック プロパティ DocumentationElement  DocumentableItem のドキュメント要素を取得または設定します。(DocumentableItem から継承されます。)
パブリック プロパティ ExtensibleAttributes  Web Services Interoperability (WS-I) Basic Profile 1.1 に準拠する WSDL の属性の拡張機能を表す XmlAttribute 型の配列を取得または設定します。(DocumentableItem から継承されます。)
パブリック プロパティ Extensions オーバーライドされます。 XML Web サービスで使用する機能拡張要素のコレクションを取得します。
パブリック プロパティ Name  項目の名前を取得または設定します。(NamedItem から継承されます。)
パブリック プロパティ Namespaces  ServiceDescription オブジェクトが生成されるときに名前空間プレフィックスと名前空間を保持するために使用する、名前空間プレフィックスと名前空間のディクショナリを取得または設定します。(DocumentableItem から継承されます。)
パブリック プロパティ Operations XML Web サービスでサポートされているアクションで使用する、データ形式およびメッセージ プロトコルの仕様のコレクションを取得します。
パブリック プロパティ ServiceDescription Binding がメンバとして含まれている ServiceDescription を取得します。
パブリック プロパティ Type Binding に関連付けられている PortType の名前空間限定名を表す値を取得または設定します。
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

Binding クラス
System.Web.Services.Description 名前空間

Binding メンバ

オブジェクトのプロパティ値とコントロールのプロパティ値との間の単純バインディングを表します。

Binding データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ PropertyName コントロールのデータ連結プロパティの名前を取得または設定します。
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
パブリック イベントパブリック イベント
参照参照

関連項目

Binding クラス
System.Windows.Forms 名前空間
BindingContext
BindingManagerBase
ComboBox
DataGrid

バインディング[binding]

ギターなどのネックやボディの縁を飾る装飾のことを指す。

バインディング

【英】:binding

ボディ、ネック、ヘッドストックなどの角に沿って付けられた縁飾りのこと。楽器の角を衝撃から保護する役割も持つ。

素材には、セルロイド、木材、貝殻などが使われる。


Binding

名前 ビンディング; バインディング; ビンディンク; ビンデング

FREEing

(binding から転送)

出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2026/02/03 04:48 UTC 版)

株式会社FREEing
FREEing CO.,LTD.
種類 株式会社
本社所在地 日本
〒〒231-0862
神奈川県横浜市中区山手町281-4
設立 2006年
業種 その他製品
法人番号 5020001056431
事業内容 玩具の企画、製作、販売、イベント、コンペディション等催し物の企画、運営、管理、飲食事業
資本金 1100万円
外部リンク https://www.freeing.co.jp
テンプレートを表示
バニーフィギュア網タイツ部分

株式会社FREEing(フリーイング)は、神奈川県横浜市中区にある企業[1]。

概要

神奈川県横浜市中区山手町281番地の4に本拠を置く[1]。

2006年8月8日設立。玩具の企画、製作、販売や、イベント、コンペディション等催し物の企画、運営、管理、飲食事業を営む[2]。

漫画、アニメ、ゲームキャラクターにバニーガールの衣装を着せたフィギュアを多く手がけており[3]、網タイツやストッキング部分に実際の布素材を用いることで、プラスチック素材やソフトビニール素材だけでは限界があった質感表現を向上させる技術を有している(実登3206026 パーツ被覆構造)[4][5]。また、日本のお笑いタレントである江頭2:50をアクションフィギュアfigma化した製品が話題となり、のちに世界の名画を題材としたfigmaシリーズ「テーブル美術館」へと発展している[6]。

なお、成人向けフィギュアを取り扱っている、「株式会社BINDing(バインディング)」は、FREEingと所在地が同じである[7]。

脚注

  1. ^ a b “株式会社FREEingの情報”. 法人番号公表サイト. 国税庁. 2021年7月24日閲覧。
  2. ^ “COMPANY PROFLIE”. FREEing. 2021年7月24日閲覧。
  3. ^ “PRODUCTS”. FREEing. 2021年7月24日閲覧。
  4. ^ “実登3206026”. 特許情報プラットフォーム. 工業所有権情報・研修館. 2021年7月24日閲覧。
  5. ^ タイツを履いていないバージョンのフィギュアを、「生足バニーVer.」として取り扱っている。
  6. ^ “【初出し画像もあり!】テーブル美術館シリーズ生みの親に直撃インタビュー!【読み応え抜群!】”. グッスマらぼ. グッドスマイルカンパニー. 2021年7月24日閲覧。
  7. ^ “株式会社BINDingの情報”. 法人番号公表サイト. 国税庁. 2021年9月8日閲覧。

関連項目

外部リンク


バインディング

(binding から転送)

出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2022/06/12 09:44 UTC 版)

ナビゲーションに移動 検索に移動

バインディング

  • 束縛 (コンピュータ)(英: binding) - コンピュータにおいて、主に「対応付け」や「関連付け」などの意味で用いられる。
  • データバインディング(英: data binding) - データベースなどとソフトウェア上の対象オブジェクトを結びつける技術。
  • スノーボードでブーツをボードに取り付けるための器具。
  • スキーでブーツを板に取り付けるための部品。ビンドング(独: Bindung)の英語読み。ビンディングを参照。
  • スポーツ自転車用のペダルのうち、トークリップとストラップによらずに靴をペダルに固定する機構を有するもの。
  • ギターなどのボディやネック、ヘッドストックの縁に施される装飾部品のこと。角を衝撃から保護する役目を果たす。

関連項目



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「binding」の関連用語

bindingのお隣キーワード
検索ランキング

   

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



bindingのページの著作権

   
実用日本語表現辞典実用日本語表現辞典
Copyright © 2026実用日本語表現辞典 All Rights Reserved.
デジタル大辞泉デジタル大辞泉
(C)Shogakukan Inc.
株式会社 小学館
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.
ヤマハミュージックメディアヤマハミュージックメディア
Copyright(C) 2000-2026 YAMAHA MUSIC MEDIA CORPORATION. All Rights Reserved.
ヤマハミュージックメディア、音楽用語ダス
楽器探そう!デジマート楽器探そう!デジマート
Copyright(c)2026 Rittor Music Inc., a company of Impress Group. All right reserved.
日外アソシエーツ株式会社日外アソシエーツ株式会社
Copyright (C) 1994- Nichigai Associates, Inc., All rights reserved.
ウィキペディアウィキペディア
All text is available under the terms of the GNU Free Documentation License.
この記事は、ウィキペディアのFREEing (改訂履歴)、バインディング (改訂履歴)の記事を複製、再配布したものにあたり、GNU Free Documentation Licenseというライセンスの下で提供されています。 Weblio辞書に掲載されているウィキペディアの記事も、全てGNU Free Documentation Licenseの元に提供されております。

©2026 GRAS Group, Inc.RSS