Retrieving active TabPage in a TabControl

B

Beorne

I have a TabControl and I'd like to retrieve the active TabPage. I
tought it was simple but the TabControl.SelectedTab method is not
implemented in cf.
Now I have the TabControl.SelectedIndex and TabControl.TabPages. The
latter is a TabPageCollection, but I'm not able to find a method to
retrieve the right element with an index.
Should I extract an enumerator and count up to the index to find the
right TabPage? This seems to me a convolute and dirty way of doing
things ...
Sometimes I wonder why MS has not developed some very easy to implement
methods in the compact framework ...

Thanks
 
B

Beorne

Beorne said:
I have a TabControl and I'd like to retrieve the active TabPage. I
tought it was simple but the TabControl.SelectedTab method is not
implemented in cf.
Now I have the TabControl.SelectedIndex and TabControl.TabPages. The
latter is a TabPageCollection, but I'm not able to find a method to
retrieve the right element with an index.
Should I extract an enumerator and count up to the index to find the
right TabPage? This seems to me a convolute and dirty way of doing
things ...
Sometimes I wonder why MS has not developed some very easy to implement
methods in the compact framework ...

It was more easy than I tought:
TabControl.TabPages[TabControl.SelectedIndex].
Sorry, I'm coming from Java and I'm not used to indexers on collections
....
 

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