|
-
Feb 8th, 2002, 10:13 AM
#1
Thread Starter
Lively Member
VB baby needs help!!
Hi Guys,
How to hide, form title
Is there anything like
Form1.title=hide?
Pls help me!
Smily
-
Feb 8th, 2002, 10:21 AM
#2
Frenzied Member
-
Feb 8th, 2002, 10:24 AM
#3
Thread Starter
Lively Member
I do not want the title bar at all, how to remove the title bar??
Cheers,
Smily
-
Feb 8th, 2002, 10:25 AM
#4
Frenzied Member
To do this at design time set the Form's BorderStyle = vbNone
To do this at run time (requires EventVB.dll):
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
HTH,
Duncan
-
Feb 8th, 2002, 10:26 AM
#5
Lively Member
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
IF Something <> "" Then
There's Something there... 
------------------------------------------
GWBASIC, QBASIC, QuickBASIC, VB5/6, A little DJGPP C++, and I hate it.
------------------------------------------
The pic u see is the logo of my favorite Christian Punk Band...Officer Negative!!!
www.OfficerNegative.com
-
Feb 8th, 2002, 10:31 AM
#6
Lively Member
hide title bar
in the properties delete the caption title and set the controlbox property to false.
-
Feb 8th, 2002, 10:33 AM
#7
Lively Member
ya, that's what it was, the controlbox property....
IF Something <> "" Then
There's Something there... 
------------------------------------------
GWBASIC, QBASIC, QuickBASIC, VB5/6, A little DJGPP C++, and I hate it.
------------------------------------------
The pic u see is the logo of my favorite Christian Punk Band...Officer Negative!!!
www.OfficerNegative.com
-
Feb 8th, 2002, 10:33 AM
#8
Thread Starter
Lively Member
VB need help!!
Hi MerrionComputin,
Didn't I tell you that I am baby in VB6
Tell me how to drop .dll into my application
Smily
-
Feb 8th, 2002, 10:36 AM
#9
Lively Member
ccrawford's method sounds much easier...
IF Something <> "" Then
There's Something there... 
------------------------------------------
GWBASIC, QBASIC, QuickBASIC, VB5/6, A little DJGPP C++, and I hate it.
------------------------------------------
The pic u see is the logo of my favorite Christian Punk Band...Officer Negative!!!
www.OfficerNegative.com
-
Feb 8th, 2002, 10:38 AM
#10
Thread Starter
Lively Member
-
Feb 8th, 2002, 10:39 AM
#11
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
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
|