Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I have MDI form. I set the child form and parent form control box and minimize box , maximize box to false. i do not understand why on my parent form menu item still show the minimize box , maximize box. If I set the child form not show. the minimize box , maximize box on the menu item disappear. Strange ? Thanks.
Posted

But all the box in the parent form is false. Do you think I need to write code for that ? See when the parent form load, I set the child form show. See all the code still did not make the box disappear.

 

Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim newTransportRecord As New frmNewTransportRecord()

newTransportRecord.MdiParent = Me

newTransportRecord.WindowState = FormWindowState.Maximized

Me.ControlBox = False

Me.MaximizeBox = False

Me.MinimizeBox = False

newTransportRecord.Show()

Me.ControlBox = False

Me.MaximizeBox = False

Me.MinimizeBox = False

newTransportRecord.Height = Me.ClientSize.Height

newTransportRecord.Width = Me.ClientSize.Width

 

 

End Sub

  • Administrators
Posted

I just tried creating a simple application. Created a MDIContainer and set it's ControlBox, Minimaze and Maximize buttons to false.

Added a child and set same as above.

Got the MDI container to create a child form and maximize it and neither had Controlbox, Minimize or Maximize buttons showing, so not sure why your's is behaving any differently. Do you have any other code that refers to these properties?

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

  • Administrators
Posted

firstly just attach code - not .exe files (even in a zip) - an admin will probably delete the attachement if it contains executables.

 

 

Not sure why it's doing it but if in the frmMain_Load event replace the line

 

newTransportRecord.WindowState = FormWindowState.Maximized

 

with something similar to

newTransportRecord.Height = Me.ClientSize.Height - Me.PictureBox1.Height - Me.MainToolBar.Height
       newTransportRecord.Width = Me.ClientSize.Width
       newTransportRecord.Location = New Point(0, Me.PictureBox1.Height)

 

you may have to juggle the numbers a bit to get it to fit.

 

Must ask though - why are you removing the control box etc. I find it really off putting to not have them there in a windows app.

 

Also would you not be able to acheive the same end result using panels or something similar?

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

Jerry sent me the file back. The control box is fine right now. I looked at that. He took off the line newTransportRecord.WindowState = FormWindowState.Maximized

newTransportRecord.Height = Me.ClientSize.Height

newTransportRecord.Width = Me.ClientSize.Width

He also made the parent form control box as false.

But I did that the same thing in my application. It did not come out . I emailed him to ask him how to do that.

 

If you click on the control box, you will understand why it bother me. Thanks.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...