TabControl::ShowToolTips Property
.NET Framework (current version)
Gets or sets a value indicating whether a tab's ToolTip is shown when the mouse passes over the tab.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Property Value
Type: System::Booleantrue if ToolTips are shown for the tabs that have them; otherwise, false. The default is false.
To create a ToolTip for a tab, set the ToolTipText property of the TabPage.
The following code example creates a TabControl with two TabPage objects. For tab page ToolTips to display, the ShowToolTips property must equal to true, as in this example. The ToolTipText property is used to assign string values to the ToolTips.
Use the System.Drawing and System.Windows.Forms namespaces for this example.
using namespace System::Drawing; using namespace System::Windows::Forms; public ref class Form1: public Form { private: TabControl^ tabControl1; TabPage^ tabPage1; TabPage^ tabPage2; void MyTabs() { this->tabControl1 = gcnew TabControl; this->tabPage1 = gcnew TabPage; this->tabPage2 = gcnew TabPage; array<Control^>^tabPages = {this->tabPage1,this->tabPage2}; this->tabControl1->Controls->AddRange( tabPages ); this->tabControl1->Location = Point(35,25); this->tabControl1->Size = System::Drawing::Size( 220, 220 ); // Shows ToolTipText when the mouse passes over tabs. this->tabControl1->ShowToolTips = true; // Assigns String* values to ToolTipText. this->tabPage1->ToolTipText = "myTabPage1"; this->tabPage2->ToolTipText = "myTabPage2"; this->Size = System::Drawing::Size( 300, 300 ); array<Control^>^formControls = {this->tabControl1}; this->Controls->AddRange( formControls ); } public: Form1() { MyTabs(); } }; int main() { Application::Run( gcnew Form1 ); }
.NET Framework
Available since 1.1
Available since 1.1
Show: