Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataRepeater

Status
Not open for further replies.

elziko

Programmer
Joined
Nov 7, 2000
Messages
486
Location
GB
The DataRepeater seems like it must must be bound to a data source.

Is there anyway I can add instances of my UserControl through code?

Is there another control which allows me to repeat a control/controls through code and not using data from a data source?

Thanks,

elziko
 
I've never tried this with a user defined control but I imagine that it should work.

Dim WithEvents y As VB.TextBox 'Your usercontrol

Private Sub Form_Load()
Dim counter As Integer
Dim tempname As String
For counter = 0 To 5
'Give each a name
tempname = "uc" & LTrim(Str(counter))
'Create them
Set y = Me.Controls.Add("VB.Textbox", tempname, Me)
'Their location and other properties
With y
.Height = 250
.Width = 2300
.Top = 1000 + (counter * 700)
.Left = 600
.Text = tempname
.Visible = True
End With
Next counter
Me.Refresh
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top