A quick bindings question.

  • Thread starter Thread starter ken
  • Start date Start date
K

ken

Hi

How do I use the bindings for a textbox via the
properties window? If I click the the bindings dropdown,
there are two properties that can be bound, tag and text.

Is this used only when I have a typed dataset, that is
placed on the form using the GUI?

Also, how do I bind a textbox to a property on the form.
I see that bindings have to be a dataset, or a array
(list). How is this done with an arraylist?

Sorry about these questions but I figure its time to
learn the windows side of dotnet as I live in the Web
world right now.
 
Using the properties window you can bind to a component that supports data
binding (e.g. a typed dataset). But you can also do data binding from code.
By doing this you can easily bind to any kind of objects. For example if you
want to bind a property of an object to a Textbox:
TextBox1.DataBindings.Add("Text", myObject, "PropertyName")
 
Ok, now how do I bind to a form's property variable.

Ie.

dim _myName as string = "Ken"

Public Property MyName() As String
Get
return _myName
End Get
Set(ByVal Value As String)
_myName = value
End Set
End Property

private sub BindTextbox
'this doesn't work.
 
Back
Top