Solved

Disable Max button on MDI form

Posted on 1998-11-04
5
785 Views
Last Modified: 2008-02-01
How I can disabled Max button on MDI parent form?
Than user can't resize MDI form,will be always MAXIMIZE.
0
Comment
Question by:igorshul
5 Comments
 
LVL 2

Expert Comment

by:dabellei
ID: 1443149
Wich version of VB
0
 
LVL 3

Expert Comment

by:fguerreiro_inix
ID: 1443150
As far as I know there is no way to turn off the Max button on the parent MDIform.  Now you can turn off the max button on a MDIChild form.   The reason for this is  that it is possible to have form that are larger than the MDIform.  The max box allows you to see everything.  Give me an Idea of what you are trying to do and maybe I can be of more help

0
 

Author Comment

by:igorshul
ID: 1443151
I'am using VB 5.0.
0
 

Author Comment

by:igorshul
ID: 1443152
I trying to make MDI Form always Maximize.
I belive there some API calls to make this button disabled or unvisible... All my Child form will be maximize also except some windows very small.When user make MDI Normal My Child form
not going to fit into it...
0
 

Accepted Solution

by:
mwiebe earned 50 total points
ID: 1443153
You can use a couple of API calls for this.

First you need to Declare the API functions:

Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (Byval hWnd as  Long,  Byval nIndex as Long) as Long

Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (Byval hWnd as  Long,  Byval nIndex as Long, ByVal NewLong as Long) as Long

Public Const GWL_STYLE = (-16)

Then in the load event of the MDIform declare a long, such as
Dim MyLong&, MyTemp&

and make the following calls

MyLong = GetWindowLong (me.hwnd,GWL_STYLE) 'This gets the window style bits
MyLong=myLong and Not (&H10000) 'this disables the max button
MyTemp= SetWindowLong (me.hwnd,GWL_STYLE),MyLong)'put the style bits back

I have used this - the Max Button is still shown, but as disabled.

Hope this helps.
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question