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

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 942
  • Last Modified:

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
0
ictis
Asked:
ictis
  • 3
  • 3
1 Solution
 
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

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.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now