Maintain Information About Code created tabs

B

Brian P. Hammer

All - I am working on a project that will use tab pages instead of MDI
interface.

Each tab will be created from code when a user creates or opens an
application file. On each tab, will be a usercontrol with my controls. Where
can I find information about maintaining information about each tab and the
name of the usercontrol on each tab? If a tab is created and my usercontrol
added, what's the way to store the name of the tab and usercontrol so that
it can be accessed elsewhere in my app?

Regards,
Brian
 
K

Kevin Yu [MSFT]

Hi Brian,

We have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
J

Jeffrey Tan[MSFT]

Hi Brian,

Thanks for your post.

In winform, there is no build-in support for this. This is actually a
language issue. I think we can use an ArrayList or some other .Net
collection data structures to store a number of HashTable references, each
one for a TabPage, so that we can use the TabPage index as the index into
the ArrayList to find corresponding HashTable. Then in the hashtable, you
can use the Control.Name as the key to store all the controls' references
on certain TabPage.

We can define the top level ArrayList as a public property/field of form
class, so that all the code in the form can access this ArrayList. Outside
of the form, once we can access the Form reference, we still can access the
public ArrayList reference.

At runtime, with the ArrayList reference, suppose we want to get control
reference named "test" on third Tabpage, we can get this reference like
this:
((HashTable)ArrayList[2])["test"]

Does this meet your need? Anyway, this is just one thought of mine, you can
implement your own data structure and your own logic at all.

Hope this helps, thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
B

Brian P. Hammer

Jeffery - This is kind of the path I am headed right now. I'll let you know
if I run into issues.

Thanks,
Brian
 
J

Jeffrey Tan[MSFT]

Ok, if you need further help, please feel free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top