| | |
Borderless MDI form
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Mar 2007
Posts: 59
Reputation:
Solved Threads: 5
Why don't you use the query unload event and place 'cancel = true' there?
Otherwise look here: http://vbnet.mvps.org/index.html?cod.../killclose.htm
*change: Private Sub Form_Load() IN Private Sub MDIForm_Load()
Otherwise look here: http://vbnet.mvps.org/index.html?cod.../killclose.htm
*change: Private Sub Form_Load() IN Private Sub MDIForm_Load()
Last edited by PVBert; Jun 10th, 2007 at 4:46 pm. Reason: added the alternative
you cannot make a mdiform borderless. instead of you can disable the close button on the titlebar of the mdiform. to disable the close button use this code :-
'declare these api functions in general section of the mdiform
Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, _
ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, _
ByVal bRevert As Long) As Long
Private Const MF_BYPOSITION = &H400&
Private ReadyToClose As Boolean
'create a sub-routine like this
Private Sub RemoveMenus(frm As Form, remove_close As Boolean)
Dim hMenu As Long
hMenu = GetSystemMenu(hwnd, False)
If remove_close Then DeleteMenu hMenu, 6, MF_BYPOSITION
End Sub
'in load event add this
Private Sub MDIForm_Load()
RemoveMenus Me, True
End Sub
'within your exit option add this
ReadyToClose = True
End
'declare these api functions in general section of the mdiform
Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, _
ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, _
ByVal bRevert As Long) As Long
Private Const MF_BYPOSITION = &H400&
Private ReadyToClose As Boolean
'create a sub-routine like this
Private Sub RemoveMenus(frm As Form, remove_close As Boolean)
Dim hMenu As Long
hMenu = GetSystemMenu(hwnd, False)
If remove_close Then DeleteMenu hMenu, 6, MF_BYPOSITION
End Sub
'in load event add this
Private Sub MDIForm_Load()
RemoveMenus Me, True
End Sub
'within your exit option add this
ReadyToClose = True
End
•
•
Join Date: Feb 2008
Posts: 1
Reputation:
Solved Threads: 0
I am a .NET developer and don't have pre-.NET skills, so forgive me if this is version-incorrect. But I have made MDI forms borderless with no problems other than getting MdiLayout to work smoothly.
I set the MdiParent's FormBorderStyle to "None". Then, I created user controls for my new "skinned" form borders and docked them respectively in the Mdi parent form. When docking, z-order controls how they layout against each other. My new "Titlebar" control implements all the functionality to move, minimize, restore, and close the form. You could simply exclude these methods to accomplish what you want.
NOTE: I realize this thread is pretty old. But I though it might help someone who comes along via their own "googling".
I set the MdiParent's FormBorderStyle to "None". Then, I created user controls for my new "skinned" form borders and docked them respectively in the Mdi parent form. When docking, z-order controls how they layout against each other. My new "Titlebar" control implements all the functionality to move, minimize, restore, and close the form. You could simply exclude these methods to accomplish what you want.
NOTE: I realize this thread is pretty old. But I though it might help someone who comes along via their own "googling".
Last edited by freQ; Feb 27th, 2008 at 1:01 pm.
![]() |
Similar Threads
- What is the difference between simple form & MDI form? (Visual Basic 4 / 5 / 6)
- By Pressing F3 on MDI Form(Parent) How can a sub menu Form will open (Visual Basic 4 / 5 / 6)
- how can I fix two child windows in a mdi form in vb 4 (Visual Basic 4 / 5 / 6)
- Framing a MDI form (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Access Function for Outlook_From Form- newbie help
- Next Thread: Increasing row height in listview
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





