Bind Dynamically Added Textbox

  • Thread starter Thread starter Randy
  • Start date Start date
R

Randy

Can anybody help me to complete the code for a dynamically added
textbox? I can get as far as adding the textbox and placing in the
right location, but now I need to bind it to a datasource. Here is my
code thus far:

Dim TextBox As New TextBox
With TextBox
.Name = "textBox" & tbl.rows.count + 1
.Size = New System.Drawing.Size(320, 20)
.Location = New Point(205, 160)


End With
Controls.Add(TextBox)

I was hoping to add a line within the With statement like ".datasource
= ds" and ".datamember = myColumn", but these are apparently not valid
members in this context.

Can anybody help?
Thanks,
Randy
 
Martin,

I see that I did not pay enough attention to the word bind.

However a dataset is a binder so it need in my idea to be a table.

MyTextBox.databindings.add("text",ds("myTable"),"MyColumn")
or
MyTextBox.databindings.add("text",myTable,"MyColumn")
or Strongly Typed
MyTextBox.databindings.add("text",ds,myTable,"MyColumn")

This because that part gives mostly the most confusion.

Cor
 
Back
Top