Hi Guys,
How to hide, form title
Is there anything like
Form1.title=hide?
Pls help me!
Smily
Printable View
Hi Guys,
How to hide, form title
Is there anything like
Form1.title=hide?
Pls help me!
Smily
umm... how bout this:
VB Code:
frmMain.Caption = ""
I do not want the title bar at all, how to remove the title bar??
Cheers,
Smily
To do this at design time set the Form's BorderStyle = vbNone
To do this at run time (requires EventVB.dll):
HTH,Code:Option Explicit
Dim WithEvents vbLink As EventVB.APIFunctions
Dim WithEvents vbWnd As EventVB.ApiWindow
Private Sub Check1_Click()
If Check1.Value = vbChecked Then
vbWnd.SetWindowStyle WS_CAPTION, False
Me.Height = Me.Height + vbLink.System.Metrics(SM_CYCAPTION)
Else
vbWnd.UnSetWindowStyle WS_CAPTION, False
Me.Height = Me.Height - vbLink.System.Metrics(SM_CYCAPTION)
End If
End Sub
Private Sub Form_Load()
Set vbLink = New EventVB.APIFunctions
Set vbWnd = New EventVB.ApiWindow
vbWnd.hWnd = Me.hWnd
End Sub
Duncan
Do you want to hide the bar itself, or just the caption??
Frm.caption=""
or if you want to hide the bar itself, I think there is a certain property that will hide it. Maybe its the form type or border type, I forget the name of the property, but its there somewhere.:(
FRAIL_KNIGHT
in the properties delete the caption title and set the controlbox property to false.
ya, that's what it was, the controlbox property....:p
Hi MerrionComputin,
Didn't I tell you that I am baby in VB6
Tell me how to drop .dll into my application
Smily
ccrawford's method sounds much easier...
Hi FRAIL_KNIGHT,
You are a star ;)
It works fine :eek: :eek:
:) :) :) :)
Good ole native VB is just fine with me.VB Code:
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Const WS_CAPTION = &HC00000 ' WS_BORDER Or WS_DLGFRAME Private Const GWL_STYLE = (-16) Private Const SWP_FRAMECHANGED = &H20 ' The frame changed: send WM_NCCALCSIZE Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Private Function DisplayCaption(ByVal IsDisplayed As Boolean) As Boolean Dim MyStyle As Long MyStyle = GetWindowLong(Me.hwnd, GWL_STYLE) If IsDisplayed Then MyStyle = MyStyle Or WS_CAPTION Else MyStyle = MyStyle And Not WS_CAPTION End If If SetWindowLong(Me.hwnd, GWL_STYLE, MyStyle) Then If MyStyle = GetWindowLong(Me.hwnd, GWL_STYLE) Then DisplayCaption = True End If End If SetWindowPos hwnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED Or SWP_NOMOVE Or SWP_NOZORDER Or SWP_NOSIZE End Function Private Sub Form_Load() 'i wrote this to be a toggle 'if you say DisplayCaption True it will redisplay it DisplayCaption False End Sub