|
-
June 12th, 2008, 03:44 PM
#1
Extend Tabpage
Hi all!
I create a class named TabPageEx which extends TabPage.
In my app, sometimes it is necessary to get the selected tab from the TabControl ( I named this object as tcDataPanes) in order to add some controls.
I tried to cast from but it does not work.
Code:
tabpage1 = new TabPageEx();
tabpage1 = (TabPageEx)tcDataPanes.SelectedTab;
An InvalidCastExpection message appears at runtime.
All tabpages that were created are TabPageEx' type. Each tabPageEx object has a FlowLayoutPanel, and there is a method at TabPageEx which returns this container to my app.
What is wrong?
Thank you in advance!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|