ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide minimise, maximise, and close buttons on form (https://www.excelbanter.com/excel-programming/293006-hide-minimise-maximise-close-buttons-form.html)

Gordon Garnsey

Hide minimise, maximise, and close buttons on form
 
Is there any way of hiding these buttons on the top right hand corner of a form. The program in question is a COM addin for Excel.

Vasant Nanavati

Hide minimise, maximise, and close buttons on form
 
UserForms don't have minimoze or maximize buttons. The Close button can be
disabled. Or are you referring to a different kind of form?

--

Vasant


"Gordon Garnsey" wrote in message
...
Is there any way of hiding these buttons on the top right hand corner of a

form. The program in question is a COM addin for Excel.



Gordon Garnsey

Hide minimise, maximise, and close buttons on form
 
I understood they were userforms but what types are there. In the Project window of the
IDE we have Forms, Modules, and Class modules.
My forms are usually of the modeless type
I am currently disabling the X button but wish to get rid of the three of them because
they are untidy, create confusion, and are not used

Gordon Garnsey

Hide minimise, maximise, and close buttons on form
 

The following shows how the form is set up. Ring any bells

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String,
ByVal lpWindowName As String) As Lon

Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Lon

Public Sub SetParentToExcel(
Level = Level + 1: StackString = StackString & "(ChartSelectorMenu:SetParentToExcel)": Debug.Print CStr(Level) & StackStrin
Dim XLHWnd As Lon
Dim MeHWnd As Lon
On Error Resume Nex
XLHWnd = FindWindow("XLMAIN", App.Caption
MeHWnd = FindWindow("ThunderRT6DFrame", Me.Caption
SetParent MeHWnd, XLHWn
Level = Level - 1: StackString = Mid(StackString, 1, InStrRev(StackString, "(", -1, 1) - 1): Debug.Print CStr(Level) & StackStrin
End Sub


All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com