Microsoft Communities

Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

When should I use Paint/OnPaint and when should I override the ToolStripRenderer?

If you want to tweak a few aspects of how an item is painted, overriding the ToolStripRenderer might be the right idea. 

If you are writing a new item and want to control all aspects of the painting, overriding  OnPaint will give you total control.  From the OnPaint, you can use methods from the ToolStripRenderer by calling Owner.Renderer.DrawItemImage(new ToolStripItemImageRenderEventArgs(e));



Page view counter