Hey all
Does anyone of you know how to remove the Header bar( not borderstyle none) So i can still size my form but not having the header.
Printable View
Hey all
Does anyone of you know how to remove the Header bar( not borderstyle none) So i can still size my form but not having the header.
Set forms ControlBox to false and remove the form text in properties, or set them in form_load at runtime.
Me.ControlBox = False
Me.Text = ""
Add this to your Form_Load
Code:Me.ControlBox = False
Me.Text = ""
D'oh!
ty, can i also get rid of the top border. Only the top one
No. Why would you want to?
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
thanks all
Does anyone of you know how to change the border style and header style??
Ive heard you can do that with package you can download.
But are there free ones too? and how to install it