I have a graphical com-component from our vendor. I placed it in main form and want to draw above it. But MainForm_paint doesn't draw above that component. Is there any way to paint above that component ?
C#, WinForms, 2.0
code:
void MainForm_Paint(object sender, PaintEventArgs e)
{
using (SolidBrush b2 = new SolidBrush(Color.Red))
{
e.Graphics.FillRectangle(b2, this.ClientRectangle);
}
Pen pen = new Pen(Color.Black, 2.0f);
e.Graphics.DrawLine(pen, 0, 0, 100, 100);
pen.Dispose();
}
It didn't fill anything and it didn't draw a line. ComComponent.DockStyle = DockStyle.Fill