Adding an image to a toolstrip in C++ and Winforms.

  • Thread starter Thread starter nigelwright7557
  • Start date Start date
N

nigelwright7557

Guest
I have been trying to add an image before some text on a toolstrip.

The code compiles fine but the image isnt drawn on the toolstrip.

Any hints would be appreciated.

ToolStripMenuItem^ g13editline = gcnew ToolStripMenuItem();
g13editline->Text = "Toolbar>>";
toolStrip1->Items->Add(g13editline);

Image^ image;
image->FromFile("c:\\temp\\play.png");
ToolStripMenuItem^ z1 = gcnew ToolStripMenuItem();
z1->Text = "asdsdas";
z1->Image = image;
// z1->DisplayStyle = ToolStripItemDisplayStyle::Image;
// z1->ImageAlign = System::Drawing::ContentAlignment::MiddleCenter;

z1->TextImageRelation= TextImageRelation::ImageBeforeText;


toolStrip1->Items->Add(z1);





n.Wright

Continue reading...
 
Back
Top