
Originally Posted by
dnear
ty, can i also get rid of the top border. Only the top one
Nope, you'd have to use a borderless form, add (draw?) your own borders and the needed code to resize the form.
Other then that, if you just don't want to allow the user to resize the form from the top you could change the message that makes that happen...
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' set form style
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.Sizable
Me.ControlBox = False
Me.Text = ""
End Sub
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
MyBase.WndProc(m)
If m.Msg = &H84 Then ' WM_NCHITTEST = &H84 'non client hit-test
Select Case m.Result.ToInt32()
' 12-14 = detect mouse over top/top-left/top-right borders
Case 12 To 14 ' see, http://msdn.microsoft.com/en-us/library/ms645618%28VS.85%29.aspx
' change the resize cursor when mouse is over form borders.
m.Result = CType(1, IntPtr) ' 1=Client, 2=Caption(allow drag form with mouse when on borders).
End Select
End If
End Sub