|
-
Jan 3rd, 2009, 01:29 AM
#1
Thread Starter
Member
Removing The Border & Title of an MDI Parent Form
Is it possible to remove the border and titlebar of an mdi parent form in vb6? I've been searching the net for a way and have yet to find one. Any help would be much appreciated!
-
Jan 3rd, 2009, 05:45 AM
#2
Addicted Member
Re: Removing The Border & Title of an MDI Parent Form
Try this.
vb Code:
Option Explicit
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 GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Const WS_CAPTION = &HC00000
Const WS_SYSMENU = &H80000
Const WS_MINIMIZEBOX = &H20000
Const WS_MAXIMIZEBOX = &H10000
Const GWL_STYLE = (-16)
Private Sub MDIForm_Load()
Dim L As Long
L = GetWindowLong(Me.hwnd, GWL_STYLE)
L = L And Not (WS_MINIMIZEBOX)
L = L And Not (WS_MAXIMIZEBOX)
L = L Xor WS_CAPTION
L = SetWindowLong(Me.hwnd, GWL_STYLE, L)
End Sub
-
Jan 12th, 2009, 05:24 PM
#3
Lively Member
Re: Removing The Border & Title of an MDI Parent Form
How would you remove the single border from the above code? So that this removes the single boder and stop from resizing the MDIform.
-
Mar 31st, 2009, 04:57 AM
#4
New Member
Re: Removing The Border & Title of an MDI Parent Form
 Originally Posted by mathy2007
How would you remove the single border from the above code? So that this removes the single boder and stop from resizing the MDIform
I was looking to do the exact samething last night ... and eventually found the solution elsewhere :
just define another constant :
Code:
Const WS_THICKFRAME = &H40000
and use the following ( NB. you no longer need to "manually" remove the min and max boxes )
Code:
Dim L As Long
L = GetWindowLong(Me.hwnd, GWL_STYLE)
L = L And Not (WS_THICKFRAME)
L = L Xor WS_CAPTION
L = SetWindowLong(Me.hwnd, GWL_STYLE, L)
-
Jan 26th, 2010, 08:41 AM
#5
Junior Member
Re: Removing The Border & Title of an MDI Parent Form
works great! thanks!
as long as you dont have a statusbar on the form
i am using a mdiform with a statusbar on the bottom and now the resize function is moved to the statusbar, which looks funny, but is not what i want 
i tried using the hwnd of the statusbar instead, but that didnt work either
does anyone have a clue how to create an mdiform which cant be resized and has no caption/controlbox and no border ?
Women forgive but never forget. Men forget but never forgive.
-
Jan 26th, 2010, 08:58 AM
#6
Re: Removing The Border & Title of an MDI Parent Form
That resize/grab handle on the status bar was always there, correct? I don't know if you can remove it without taking control over drawing the statusbar yourself and/or preventing mouse events over that corner. However, you can disable the statusbar which prevents users from dragging that corner.
Code:
Private Declare Function EnableWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
' Example:
EnableWindow MDIForm1.StatusBar1.hwnd, 0& ' 0&=False, 1&=True
-
Jan 26th, 2010, 09:12 AM
#7
Junior Member
-
Jan 26th, 2010, 11:38 AM
#8
Re: Removing The Border & Title of an MDI Parent Form
The StatusBar resize/grab handle is only visible if it's Align property is set to 2 - vbAlignBottom. You could add a PictureBox to the MDI form aligned to the bottom and then place the StatusBar in the PictureBox. Since the StatusBar is in the PictureBox it can no longer be Aligned. Use the PictureBoxes Resize event to adjust the StatusBar to completely fill the PictureBox client area.
Code:
Private Sub Picture1_Resize()
StatusBar1.Move 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight
End Sub
-
Jan 28th, 2010, 03:09 AM
#9
Junior Member
Re: Removing The Border & Title of an MDI Parent Form
Women forgive but never forget. Men forget but never forgive.
-
May 28th, 2019, 09:05 AM
#10
New Member
Re: Removing The Border & Title of an MDI Parent Form
Thanks a lot bro
-
May 28th, 2019, 09:12 AM
#11
New Member
Re: Removing The Border & Title of an MDI Parent Form
 Originally Posted by LaVolpe
That resize/grab handle on the status bar was always there, correct? I don't know if you can remove it without taking control over drawing the statusbar yourself and/or preventing mouse events over that corner. However, you can disable the statusbar which prevents users from dragging that corner.
Code:
Private Declare Function EnableWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
' Example:
EnableWindow MDIForm1.StatusBar1.hwnd, 0& ' 0&=False, 1&=True
Try "bigmox68 "( Mar 31st, 2009, 02:57 PM #4) his post. it's an great idea.
-
May 28th, 2019, 05:05 PM
#12
Re: Removing The Border & Title of an MDI Parent Form
doss....you DO realize this is a 9 year old+ thread?????????????????????????????????
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
|