Amiras

Amiras

  • NA
  • 2
  • 0

Visual studio tab control, add image?

Jan 26 2010 4:34 AM
I was wondering how to add image near the tab name to tab control, in Visual studio.

Visual studio generated code looks like this:


      //
// tabControl1
//
this->tabControl1->Controls->Add(this->tabPage1);
this->tabControl1->Controls->Add(this->tabPage2);
this->tabControl1->Controls->Add(this->tabPage3);
this->tabControl1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(0)));
this->tabControl1->ImeMode = System::Windows::Forms::ImeMode::NoControl;
this->tabControl1->ItemSize = System::Drawing::Size(20, 15);
this->tabControl1->Location = System::Drawing::Point(12, 60);
this->tabControl1->Name = L"tabControl1";
this->tabControl1->SelectedIndex = 0;
this->tabControl1->Size = System::Drawing::Size(730, 254);
this->tabControl1->TabIndex = 11;
//
// tabPage1
//
this->tabPage1->BackColor = System::Drawing::SystemColors::Highlight;
this->tabPage1->Location = System::Drawing::Point(4, 19);
this->tabPage1->Name = L"tabPage1";
this->tabPage1->Padding = System::Windows::Forms::Padding(2);
this->tabPage1->Size = System::Drawing::Size(722, 231);
this->tabPage1->TabIndex = 0;
this->tabPage1->Text = L"1 tab";
//
// tabPage2
//
this->tabPage2->ForeColor = System::Drawing::Color::Red;
this->tabPage2->Location = System::Drawing::Point(4, 19);
this->tabPage2->Name = L"tabPage2";
this->tabPage2->Padding = System::Windows::Forms::Padding(1);
this->tabPage2->Size = System::Drawing::Size(722, 231);
this->tabPage2->TabIndex = 1;
this->tabPage2->Text = L"2 tab";
this->tabPage2->UseVisualStyleBackColor = true;
//
// tabPage3
//
this->tabPage3->Location = System::Drawing::Point(4, 19);
this->tabPage3->Name = L"tabPage3";
this->tabPage3->Padding = System::Windows::Forms::Padding(3);
this->tabPage3->Size = System::Drawing::Size(722, 231);
this->tabPage3->TabIndex = 2;
this->tabPage3->Text = L"3 tab";
this->tabPage3->UseVisualStyleBackColor = true;



tabPage1->Image gives me error, its probably used only for buttons, please help me I am stucked here.