Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,

I hope somebody can help. I am trying to add a dynamic RichTextBox to a dynamically added TabPage, I am designing a MultiPort Terminal Emulater software and I need to create a dynamic TabPage for each serial port on the computer.

I can dynamically create a TabPage and a RichTextBox but, I just cannot figure out how to add the RichTestBox to the TabPage

Regards
Simon
Posted

1 solution

MIDL
RichTextBox r = new RichTextBox();
r.Height = 30;
r.Width = 100;
r.Name = "tbox1";
this.tabControl1.TabPages[0].Controls.Add(r);
// replace tabControl1 with your tabControl name...
 
Share this answer
 
Comments
parmar_punit 13-Jun-11 6:11am    
I hope this will helpful to you....
Simon Nixon 17-Jun-11 9:06am    
Thanks worked a treat. ;-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900