
About creating RTF Boxes at run-time
If rtfText is an existing RTB, just set it's Index property = 0 which
creates an array. Then use something like...
'===============
Private Sub cmdAddAnother_Click()
Dim iNewOne As Integer
iNewOne = rtfText.UBound + 1
Load rtfText(iNewOne)
With rtfText(iNewOne)
.Move WhereEver
.Visible = True
End With
End Sub
Private Sub rtfText_Change(Index As Integer)
'Note that each event handler now has
'Index As Integer to let you know
'which control raised the event
End Sub
'===============
Also note that if you already have code in some of the event handlers,
you'll need to add that "Index As Integer" param to those subs.
Quote:
> Hello,
> Is it possible anyhow to create new RichText boxes at run-time? I tried
> the following way...
> Dim rtfNew As (controltype)
> Set rtfNew = New rtfText
> ...where rtfText is an existing text box in form. But it doesn't work as
> (controltype) cannot be set to RTF text box. If this is somehow
> possible, then how I could identify several copied controls from each
> other? Each copy will have the same code-level name (rtfNew)...
> Hope that you understand my not-so-perfect english!
> Thanks
> --