mick said:
I tried asking this in the windowsforms group but there seems
to be very little life there.
I want to create a little window that has the thick border you
get when you set the FormBorderStyle to SizeableToolWindow
bit I dont want it to be sizable (similar to the Volume Control on
Win 7). I have set the MaximumSize property to prevent sizing
but the cursor still changes to the resize cursor when it hits the
border. How do I stop that happening?
Does FormBorderStyle.FixedDialog or FormBorderStyle.Fixed3D not create a
non-resizable window drawn the way you want?
If not, while I'm afraid I don't have a specific answer, I have some
other ideas.
It's been awhile, so I don't recall if there are specific window style
flags that would allow this in unmanaged code. But if there are, you
can override the CreateParams property in your Form sub-class and set
the appropriate flags that will keep the thick border but set it to
non-resizable.
This would be the closest "pure .NET" solution I think might work. And
you'll still have to look up the specifics on the style flags that might
control that in the unmanaged Win32 API docs.
If there are no such flags, then you may have to create your own
unmanaged window class that draws a thick border but which isn't
resizable. Using this approach, again you would have to override
CreateParams. But in that case, rather than just manipulating the style
flags, you'd have to set the window class name property to the window
class you want to use (being sure, of course, to have your window class
extend the normal window class used in a Form; assuming .NET uses a
named, registered window class of course…I don't recall off the top of
my head if it does).
Personally, if I had a window that needed to be non-resizable, I'd just
use one of the border styles that is non-resizable and be done with it,
even though it might not be exactly the appearance I was hoping for.

Doing all that work just to get the window border to draw a specific
way seems like a big waste of time, time you could spend on much more
important things.
I mean, really…just how important could having an exact border style be?
Pete