Create a maximize & minimize button in userform
-
- Administrator
- Posts: 78596
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Create a maximize & minimize button in userform
In my Excel 2007, your code does that, but it's useless, as I pointed out.
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Re: Create a maximize & minimize button in userform
Try this:
You do not have the required permissions to view the files attached to this post.
Nathan
There's no place like home.....
There's no place like home.....
-
- SilverLounger
- Posts: 2347
- Joined: 23 Feb 2010, 12:07
Re: Create a maximize & minimize button in userform
I guess now I got what I was searching for. Thanks Nathan. I appriciate your help. I dont see any difference in this code. I guess the foreward or backwared button is added. Anyway thanks for the help once again.
Best Regards,
Adam
Adam
-
- SilverLounger
- Posts: 2347
- Joined: 23 Feb 2010, 12:07
Re: Create a maximize & minimize button in userform
Which lines should I remove If I want the maximize button to be removed from the form? when the form is maximized it looks pretty annoying.
Any suggestions would be kindly appreciated.
Any suggestions would be kindly appreciated.
Best Regards,
Adam
Adam
-
- Administrator
- Posts: 78596
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Create a maximize & minimize button in userform
The lines that modify the title bar are
It's easy to see what you should do to remove, or rather disable, the maximize button.
Code: Select all
lngCurrentStyle = GetWindowLong(lngHwnd, GWL_STYLE)
lngNewStyle = lngCurrentStyle Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
lngNewStyle = lngNewStyle And Not WS_VISIBLE And Not WS_POPUP
SetWindowLong lngHwnd, GWL_STYLE, lngNewStyle
Best wishes,
Hans
Hans
-
- SilverLounger
- Posts: 2347
- Joined: 23 Feb 2010, 12:07
Re: Create a maximize & minimize button in userform
Does the above refer to remove the textIt's easy to see what you should do to remove, or rather disable, the maximize button.
Code: Select all
Or WS_MAXIMIZEBOX
Code: Select all
lngNewStyle = lngCurrentStyle Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
Best Regards,
Adam
Adam
-
- Administrator
- Posts: 78596
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Create a maximize & minimize button in userform
Why don't you try it?
If it does what you want, fine. If it doesn't, it's easy to restore the code.
If it does what you want, fine. If it doesn't, it's easy to restore the code.
Best wishes,
Hans
Hans
-
- SilverLounger
- Posts: 2347
- Joined: 23 Feb 2010, 12:07
Re: Create a maximize & minimize button in userform
I did & It works. Just thought It might give me some error messages. That's why wanted to get a clarification from you.
Best Regards,
Adam
Adam