本文整理匯總了VB.NET中System.Windows.Forms.BindingSource.Add方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET BindingSource.Add方法的具體用法?VB.NET BindingSource.Add怎麽用?VB.NET BindingSource.Add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Forms.BindingSource
的用法示例。
在下文中一共展示了BindingSource.Add方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: PopulateBindingSourceWithFonts
Private WithEvents bindingSource1 As New BindingSource()
Private box1 As New TextBox()
Private Sub PopulateBindingSourceWithFonts()
bindingSource1.Add(New Font(FontFamily.Families(2), 8.0F))
bindingSource1.Add(New Font(FontFamily.Families(4), 9.0F))
bindingSource1.Add(New Font(FontFamily.Families(6), 10.0F))
bindingSource1.Add(New Font(FontFamily.Families(8), 11.0F))
bindingSource1.Add(New Font(FontFamily.Families(10), 12.0F))
Dim view1 As New DataGridView()
view1.DataSource = bindingSource1
view1.AutoGenerateColumns = True
view1.Dock = DockStyle.Top
Me.Controls.Add(view1)
box1.Dock = DockStyle.Bottom
box1.Text = "Sample Text"
Me.Controls.Add(box1)
view1.Columns("Name").DisplayIndex = 0
box1.DataBindings.Add("Text", bindingSource1, "Name")
End Sub
Sub bindingSource1_CurrentChanged(ByVal sender As Object, ByVal e As EventArgs) _
Handles bindingSource1.CurrentChanged
box1.Font = CType(bindingSource1.Current, Font)
End Sub