I would create my own form that derives from Form, and override
OnResize(). Change OnResize() to check the window width and height and
change them if they are not a multiple of 50 pixels.
I tried it myself... the code looks like this:
protected override void OnResize(EventArgs e)
{
if (this.Width % 50 != 0)
{
this.Width = (int)(Math.Ceiling(this.Width / 50.0) * 50);
}
if (this.Height % 50 != 0)
{
this.Height = (int)(Math.Ceiling(this.Width / 50.0) * 50);
}
base.OnResize (e);
}
I'll warn you that the border redrawing while you're resizing at run
time looks really weird: you get a dual border flickering look, one
border where the mouse is actually dragging and another at the size the
window will really be when you release the mouse. However, it does
produce a window that has a height and width of a multiple of 50
pixels, and it allows you to resize it appropriately.
(Of course, if you take the border into account, etc, you will have to
revise the mathematics, but be careful: if you don't do it carefully
you may get an infinite loop as the OnResize method causes a resizing
that ends up calling it back.)