yan19454 Posted October 22, 2003 Posted October 22, 2003 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. Quote
Administrators PlausiblyDamp Posted October 22, 2003 Administrators Posted October 22, 2003 If you set the child form to not show the Minimize, Maximize and control box items then the child won't. The parent will as you've not told the parent not to display them. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
yan19454 Posted October 22, 2003 Author Posted October 22, 2003 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 Quote
Administrators PlausiblyDamp Posted October 22, 2003 Administrators Posted October 22, 2003 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? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
yan19454 Posted October 22, 2003 Author Posted October 22, 2003 See my attachedment. Thanks.transportmanager.zip Quote
Administrators PlausiblyDamp Posted October 22, 2003 Administrators Posted October 22, 2003 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? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
yan19454 Posted October 22, 2003 Author Posted October 22, 2003 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.