Windows Develop Bookmark and Share   
 index > Windows Forms Designer > .NET Magic TabControl Help
 

.NET Magic TabControl Help

I’m playing with the Magic .NET UI [http://crownwood.net] TabControl, and I'm stuck on something. 

I'm creating new tab pages programmatically, and each page has a richtextbox as it’s only control.  My question is: how do I access the members of my richtextbox from the mainmenu of my mainform. 

For example, if I were to simply put the rtb on my mainform, I could call rtb.Paste(), or rtb.Copy() etcâ€?nbsp; But this does not appear to be the case while on a tabPage.  

The project I’m working on is a simple tabbed text editor written in c# which can be found at http://sourceforge.net/projects/sharpedit.  I am very new to C#, and I have been fussing with this problem for a loooooong time.  If anyone could take the time to check out my code & help me figure out what’s going on, I would be incredibly grateful 

Thanks 
DB 
MigrationUser 1  Tuesday, February 04, 2003 7:16 PM
I'm not intimately familiar with the object model of the Magic TabControl, but I'm guessing that the tab page has a Controls collection and your RichTextBox will be in there.  

Since, as you say, there will only be one control in each TabPage, you can probably write some code like:

RichTextBox rtb = (RichTextBox)TabControl.TabPages[xxx].Controls[0];

This gets the zeroth control out of the tab page's cotnrols collection and casts it to a RichTextBox.

good luck
 - mike
MigrationUser 1  Wednesday, February 05, 2003 4:02 AM
Thanks so much Mike!

Works great.
Dan
MigrationUser 1  Wednesday, February 05, 2003 3:44 PM

You can use google to search for other answers

Custom Search

More Threads

• Autoscroll issues in tabControl
• Bulk Update in .NET
• inheriting from an existing Windows Forms control
• Visual studio designer host fails to serialize component when custom component designer inserts code into code view
• Visual Studio 2003 hangs up at start if I closed with a design view active
• listbox ownerdraw doesn't redraw when multiselect is on
• Finding a text in textbox control
• status strip trouble: cant find status panel
• Designsurface Copy and Paste
• hot tracking menuitems