Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Disable Max button on MDI form

Posted on 1998-11-04
5
Medium Priority
?
821 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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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

618 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