Solved

Disable Max button on MDI form

Posted on 1998-11-04
5
804 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

691 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