Solved

Disable Max button on MDI form

Posted on 1998-11-04
5
774 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Replace Formatted Numbers with text 9 51
VBA color chart bars 12 65
Run code from text file in vb 1 32
Copy a row 12 52
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now