How 2 prevent a form resize when double clicking its title bar ?
Dear all.
I want 2 have a title bar but when it is being double clicked my beautiful form getting resized (should B maximized at all times)
I was trying 2 handle the Resize event - but how can I catch the resize and send a cancellation message instead ?
Any help, clues or samples R very blessed.
[304 byte] By [
Yovav] at [2007-12-17]
You can set the minimum and maximum size of your form. If you set these to the screen res, then even if the user double clicks, the form will not resize. It's a bit user hostile tho, why can't your form resize itself to whatever part of the screen the user wants ?
Maximized at all times? Set the
MaximizeBox and
MinimizeBox properties to
false and and the
WindowState property to
Maximized at design-time, and don't worry about it again.
The thing with the WindowState and MaximizeBox and MinimizeBox did not work,
it only work if I set my window size to a specific size - then its resizing to that size,
Does anyone know how can I get the current screen Hieght and Width and what should I add or deduct from that in order to set the size of the form exactly as big as the maximized window ?
Thanks in advance.