MDI Cild disable/hide min/max button when maximised.

This *should* be an easy one!!

I have an MDI child which I use maximised. However, even though the control box is false, the max/min buttons are still enabled.

How can I hide/disable the max/min buttons

Using VB.net 2003
LVL 1
ictisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RonaldBiemansCommented:
Well actually there is a bug or ommision there, you can disable the min and max button setting the minimize/ maximize box to false. The problem is when you maximize a mdi child the maximize box is replaced by the  restore box which you cannot disable.

So you have to do that in code, the resize event of the form lets you do that (but it doesn't look that great)
0
ictisAuthor Commented:
Yes, I'd realised that. I have code in resize whic re-maximises the form, but it's not very professional looking.

Surely there must be a way of removing all control buttons???
0
RonaldBiemansCommented:
Yes, I just found one

try this in the resize event of your form

Private Sub ObjectSearch_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
        Me.ControlBox = False
    End Sub

and set form form borderstyle to fixedsingle
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

ictisAuthor Commented:
Already got that - when the form is maximised the buttons appear.
0
RonaldBiemansCommented:
You have that in the resize event ? Because I tested it here and I don't have the boxes anymore.

Also you have to set the borderstyle to fixedsingle like I said before.
0
ictisAuthor Commented:
Hmm.. odd - it works now!!

Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.