What is the purpose of TabPage.Hide()

71 views Asked by At

When the TabPage.Hide() doesn't have any effect why is still available? tcImgBase.TabPages["tabPage3"].Hide();

The general implementation to hide a tab page is to remove it. Can someone explain the scope of Hide & Show?

1

There are 1 answers

0
siride On BEST ANSWER

The Hide() method just changes the Visible property. It's implemented in the Control class, which is the base class for all Windows Forms controls. That means that all controls have this method and property and it can't be hidden since that's how C# works. However, it's not meaningful for all controls, such as TagPage and, indeed, the MSDN documentation says as much:

This member is not meaningful for this control.

And later:

To hide a tab in a TabControl, you must remove it from the control's TabPages collection.

Both from: http://msdn.microsoft.com/en-us/library/vstudio/y6e1ah1k(v=vs.100).aspx.