|
-
Aug 25th, 2012, 11:15 AM
#1
Thread Starter
New Member
Removing header bar
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.
-
Aug 25th, 2012, 11:26 AM
#2
Re: Removing header bar
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 = ""
-
Aug 25th, 2012, 11:28 AM
#3
Re: Removing header bar
Add this to your Form_Load
Code:
Me.ControlBox = False
Me.Text = ""
-
Aug 25th, 2012, 11:29 AM
#4
Re: Removing header bar
-
Aug 25th, 2012, 12:13 PM
#5
Thread Starter
New Member
Re: Removing header bar
ty, can i also get rid of the top border. Only the top one
-
Aug 25th, 2012, 12:24 PM
#6
Re: Removing header bar
No. Why would you want to?
-
Aug 25th, 2012, 12:41 PM
#7
Re: Removing header bar
 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
Last edited by Edgemeal; Aug 25th, 2012 at 12:52 PM.
Reason: typo
-
Aug 26th, 2012, 03:42 AM
#8
Thread Starter
New Member
Re: Removing header bar
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
-
Aug 26th, 2012, 08:15 AM
#9
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|