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

[834 byte] By [codefund.com] at [2008-2-6]
# 1
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

codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Designer...
# 2
Thanks so much Mike!

Works great.
Dan

codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Designer...