dotnetmonitor.com

 
Index
Previous
Next

 

Use draw from custom ToolStrip handler which is the entry point into Renderer code. OnRender* will be called as a result. To change Renderer behavior, override OnRender*.

 

public class MyLabel : ToolStripLabel{

protected override void OnPaint(PaintEventArgs e) {

 

 

// Advantage here is that youd get free disabled image support

this.Parent.Renderer.DrawItemImage(new ToolStripItemImageRenderEventArgs(e.Graphics, this, this.Image, this.Bounds));

 

 

}

}

Painting
When should I use Paint/OnPaint and when should I override the ToolStripRenderer?
Do I need to worry about double buffering?
Parenting
Partial Trust
Usage