Create Multiline Text Box at Run Time 
Author Message
 Create Multiline Text Box at Run Time

The following statement creates a Text Box at run time.

Set TextBoxData = Me.Controls.Add("vb.TextBox", "TextBoxData", Me)

The created text box is Multiline = False, and the Multiline property
is ReadOnly at Run Time.

Is there any way to modify the above statement to create the text box
as Multiline = True?

Any other way?

Thanks,

Fred Holmes



Mon, 05 Jan 2004 21:26:52 GMT  
 Create Multiline Text Box at Run Time
Hi Fred:

Quote:
> Is there any way to modify the above statement to create the text box
> as Multiline = True?

Nope.

Quote:
> Any other way?

The problem is that the textbox has to be recreated to change the style bits, and vb does not support this at runtime.
At one time you could do this using third party tools (such as Spyworks from Desaware), but I don't know if the tools still have
this capablility for VB6.

Another option I have seen used, it to create two usercontrols where each control contains a txtbox, one is single line, the other
is multiline.  Then you can use controls.add to add whatever user control is reqr.

Hope this helps,

Doug.



Tue, 06 Jan 2004 02:47:30 GMT  
 Create Multiline Text Box at Run Time
I tried using SetWindowLong to change the TextBox's style to
multiline, but doesn't work.
Another solution might be to encapsulate a single-line textbox
in a separate ActiveX control and a multi-textbox in another
ActiveX control. You could also create a single ActiveX
control which contains both, a single-line and a multi-line
TextBox, and show the one or the other depending on the
multiline property.

Hope this helps

Alexander Kienzle


Quote:
> The following statement creates a Text Box at run time.

> Set TextBoxData = Me.Controls.Add("vb.TextBox", "TextBoxData", Me)

> The created text box is Multiline = False, and the Multiline property
> is ReadOnly at Run Time.

> Is there any way to modify the above statement to create the text box
> as Multiline = True?

> Any other way?

> Thanks,

> Fred Holmes



Fri, 09 Jan 2004 21:18:35 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Create Text Box or Label at Run Time ?

2. Creating new text boxes at run time

3. Creating new text boxes at run time

4. Adding text to a multiline text box

5. Assigning Multi line text to a multiline text box

6. Displaying text in a multiline text box

7. How to print MultiLine Text from Text box

8. About creating RTF Boxes at run-time

9. loading text boxes at run-time

10. changing the datasource property of a text box at run time

11. HELP: Adding text boxes during run time

12. Drag Text Box In Run Time

 

 
Powered by phpBB® Forum Software