Hi, I display a winform as a dialog (with ShowDialog over a main window). So, I set the FormBorderStyle to None because I wanted neither the control boxes nor the title bar. Though, I would like a border drawn (for example a blue border like normal windows) and keep the ability to move the form. I don't need the ability to resize it. I tried to draw a border by overriding OnPaint but it is never called. Here is my code :
protected override void OnPaint (PaintEventArgs e)
{
base.OnPaint (e);
int borderWidth = 2;
Color borderColor = Color.Blue;
ControlPaint.DrawBorder (e.Graphics, e.ClipRectangle, borderColor,
borderWidth, ButtonBorderStyle.Solid, borderColor, borderWidth,
ButtonBorderStyle.Solid, borderColor, borderWidth, ButtonBorderStyle.Solid,
borderColor, borderWidth, ButtonBorderStyle.Solid);
}
Any help would be greatly appreciated.