Folks, this is just another heads-up over a problem that drove me mad for
the last hour. I remember this happened to me about 5 years ago and I posted
the answer in here as well, but I can't find that answer and I couldn't
remember it.

 

I'm using a standard ToolStrip control in my WinForms app with some
ToolStripButton items. I wanted the Small (16x16) and Large (32x32) toolbar
icons effect you see in some popular apps, but whenever I changed the size
of the image in the buttons nothing would change. There is a lot of
completely misleading and/or wrong information on this subject on the web.
This is the real answer:

 

button.ImageScaling = ToolStripItemImageScaling.None;

 

All you have to do is set that property on each button and the whole toolbar
and the buttons will elastically resize to the contents.

 

Greg

 

Ps. Perhaps I won't forget this again. Perhaps WinForms ToolStrip controls
will be a things of the past one day and the problem will be history.

Reply via email to