I have a form which I'm bringing up using ShowDialog
which contains a couple of text boxes, labels and a button. The problem I'm having is that the text boxes are being drawn before the form itself and the other controls are drawn.
I am overriding the OnPaint
method I'm not sure if this could be causing the problem:
protected override void OnPaint(PaintEventArgs e)
{
ControlPaint.DrawBorder(e.Graphics, e.ClipRectangle, Color.Black, ButtonBorderStyle.Solid);
base.OnPaint(e);
}
It's only a slight delay but it's visible and annoying. Thank you.
The form is double buffered by the way.
EDIT: I have pinpointed the issue to be the fact that the form does not have a FormBorderStyle
. With the FormBorderStyle
set to Sizable
, this issue does not occur. However please note that having FormBorderStyle.None
as my border style is necessary, so I have not found a solution yet.