|
-
Aug 13th, 2000, 01:51 PM
#1
Thread Starter
New Member
How do I hide a form's titlebar?
Setting ControlBox, MaxButton, etc. to false and Caption to nothing works, but I need to keep the caption in the taskbar.
-
Aug 13th, 2000, 02:02 PM
#2
set borderstyle to none(0)
-
Aug 13th, 2000, 03:19 PM
#3
By default, when you set the BorderStyle to 0-None, the ShowInTaskBar property changes to False, so make sure you set it back to True.
-
Aug 13th, 2000, 03:24 PM
#4
well I would keep it false, because when you dont have a title bar, it gets a little screwed up,
when you try to minimize the form(by clicking on the taskbar icon) nothing happens, you have to use your own minimize code,
which isnt really a problem, but it kind of bugs me I cant minimize it by clicking in the taskbar.
-
Aug 17th, 2000, 12:16 PM
#5
Fanatic Member
Set ControlBox, MinButton and Maxbutton to False and set the caption to " " instead of ""...
-
Aug 17th, 2000, 12:46 PM
#6
Mad Compie: But that will set the caption to " ". Setting the BorderStyle to None will still keep the original caption.
-
Aug 18th, 2000, 02:09 PM
#7
Fanatic Member
Yes indead, I missed the plot.
But you can create your own caption bar!
Make a form only have a border or something.
Draw your caption using AutoRedraw=True and Form.Print Method.
In your Form_MouseMove Event check the absolute X Y values, if between a certain range, then use the SendMessage() API to move your Form while holding the mouse button.
-
Aug 18th, 2000, 03:14 PM
#8
Yes, you could create a TitleBar, but in this case he wants to hide the TitleBar on the Form but still keeping it in the TaskBar. Setting the BorderStyle to 0-None will accomplish this.
-
Aug 18th, 2000, 04:02 PM
#9
Frenzied Member
Try This....
Border Style = 3
Caption = ""
ControlBox = False
And Use..
Public X2 As Double, Y2 As Double
Public m_Down As Boolean
Private Sub Form1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
m_Down = True
X2 = X
Y2 = Y
end Sub
Private Sub Form1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If (m_Down = True) Then
Me.Move Me.Left - (X2 - X), Me.Top - (Y2 - Y)
End If
End Sub
Private Sub Form1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
m_Down = False
End Sub
That should do it
-
Aug 18th, 2000, 11:30 PM
#10
this is a bit easier and Faster(uses API)
Code:
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Select Case Button
Case 1
ReleaseCapture
SendMessage Me.hwnd, 161, 2, 0
End Select
End Sub
and BTW your code doesnt even work.
-
Aug 19th, 2000, 04:06 AM
#11
Fanatic Member
Yes indeed, that's what I also had in mind.
"SendMessage(Me.hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&)"
-
Aug 19th, 2000, 05:13 AM
#12
thank you!
I never knew the constant names, just the value that was supposed to be in there.
-
Aug 19th, 2000, 05:49 AM
#13
Fanatic Member
You're welcome.
Try also http://www.allapi.net, which contains an excellent API viewer with a lot of sample codes! ("API Guide")
-
Aug 19th, 2000, 12:27 PM
#14
oh yeah, I have that, but half the declares arent there, because everytime I try to update the damn thing, it gets about half way and then it just stops.
-
Aug 19th, 2000, 12:33 PM
#15
If you want all off the documented API's, I suggest you download the Platform SDK, however, in order to read/understnad them, you must have an understanding of C/C++.
-
Aug 22nd, 2000, 12:53 PM
#16
Fanatic Member
This is huge, this SDK from Bill. But I think that the 500MB download will slow down my system...
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
|