About creating RTF Boxes at run-time 
Author Message
 About creating RTF Boxes at run-time

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

--



Sat, 31 Jan 2004 05:41:30 GMT  
 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

> --




Sat, 31 Jan 2004 05:58:25 GMT  
 About creating RTF Boxes at run-time
Well, the solution was pretty much easier than I thought. =)
Thank you!

Quote:

> 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.



> > 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

> > --


--



Sat, 31 Jan 2004 16:52:54 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. rtf box at run-time

2. Create Text Box or Label at Run Time ?

3. Creating new text boxes at run time

4. Creating new text boxes at run time

5. Create Multiline Text Box at Run Time

6. Creating forms at run time, not design time.

7. Question: How to create a RTF Box left click

8. Disable RTF format in a RTF Box

9. Microsoft Visual C++ Run time library Run time error R6025

10. Code running in design time or run-time?

11. Microsoft Visual C++ Run time library Run time error R6025

12. How do I create a time input box?

 

 
Powered by phpBB® Forum Software