"ThunderMusic" <No*************************@NoSpAm.comwrote in message
news:ed**************@TK2MSFTNGP02.phx.gbl...
>I found the answer on this page http://www.dotnetrix.co.uk/menus.html
That would be
http://www.dotnetrix.co.uk/misc.html
I have been working on better examples, but have put them aside for the
moment as I work on other stuff, but if you want to make the form resizable,
then I would suggest that you leave the FormBorderstyle as is and set the
Caption to "" and ControlBox to False. This will leave you with a 3d border
around the form which needs to be trimmed off when building the region, but
it will enable the Size option in the Window Menu.
If you then define a Border Region you can send WM_NCLBUTTONDOWN messages,
in response to mousedown within the region, with one of the following
NCHITTEST flags as the wParam in order to get window sizing when dragging by
an edge.
HTLEFT
HTRIGHT
HTTOP
HTTOPLEFT
HTTOPRIGHT
HTBOTTOM
HTBOTTOMLEFT
HTBOTTOMRIGHT
Also make sure you disable Visual Styles on the window as this will increase
painting performance and you won't be using them on a skinned window. The
following is the method that I use to disable Visual Styles on the form,
whilst still allowing them on the controls:
<DllImport("uxtheme.dll")_
Public Shared Function SetWindowTheme(ByVal hwnd As IntPtr, _
ByVal pszSubAppName As String, ByVal pszSubIdList As String) As IntPtr
End Function
Protected Overrides Sub CreateHandle()
MyBase.CreateHandle()
If OSFeature.Feature.IsPresent(OSFeature.Themes) Then
SetWindowTheme(Me.Handle, String.Empty, "")
End If
End Sub
--
Mick Doherty
http://dotnetrix.co.uk/nothing.html