This may seem like a simple question but how do you remove the close "x" and the minimize and restore down buttons from the top of the forms?
Thanks in advance ATGE!
Printable View
This may seem like a simple question but how do you remove the close "x" and the minimize and restore down buttons from the top of the forms?
Thanks in advance ATGE!
Set the ControlBox property to False.
Martin's solution is suitable only if you don't need to change "this" at run time. If you need to disable the "X" button (or any other) at run-time, you could use the module I attached.
Thank you very much indeed simple problem easily solved. thx!
If all you want to do is to prevent the user from closing the form you can use the following and just hide the form or just prevent the form from unloading:
VB Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) On Error GoTo Form_QueryUnload_Error If UnloadMode = vbFormControlMenu Then 'the X has been clicked or the user has pressed Alt+F4 Cancel = True Me.Hide End If On Error GoTo 0 Exit Sub Form_QueryUnload_Error: MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Form_QueryUnload of Form " & Me.name End Sub