[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Disable Max button on MDI form

Posted on 1998-11-04
5
Medium Priority
?
825 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 200 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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

873 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