sethindeed Posted February 12, 2003 Posted February 12, 2003 I used to use this property in VB6 to automatically arrange all the child forms within an MDI Form. This property is gone. Is there a new syntax to tile and cascade child forms ? thx ! Quote What I don't know keeps me excited...
Moderators Robby Posted February 12, 2003 Moderators Posted February 12, 2003 Me.LayoutMdi(MdiLayout.Cascade) Me.LayoutMdi(MdiLayout.TileHorizontal) Me.LayoutMdi(MdiLayout.TileVertical) Quote Visit...Bassic Software
sethindeed Posted February 12, 2003 Author Posted February 12, 2003 Wow ! Thanx Robby. One quick question for you, do you know how to setfocus on a form and bring it up front if it is already opened ? ( I have already wrote a routine to prevent a form from opening two times, I just need to add a piece of code to set the focus on the form ) Quote What I don't know keeps me excited...
*Experts* Nerseus Posted February 12, 2003 *Experts* Posted February 12, 2003 If you have a reference to the openened form, just call Focus and/or BringToFront. -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
sethindeed Posted February 12, 2003 Author Posted February 12, 2003 What do you mean by reference Nerseus ? At this point, I have the following code : Dim frmCompany As New frmCompany () If 'the form is already loaded' Then frmCompany.Focus frmCompany.BringToFront I tried both of these methods earlier today with no results :( Any clues ? Quote What I don't know keeps me excited...
*Experts* Volte Posted February 12, 2003 *Experts* Posted February 12, 2003 You can't just use the new instance of the form. You have to make sure you're using the same instance. I'm assuming you're using a For Each to check to see if the form is loaded; on the interation through the loop in which you determine it's loaded, use the Focus method on the form object that is assigned to the form loop:For Each dummy In mdi.MDIChildren 'if it's loaded then dummy.Focus(); 'end if Next Quote
sethindeed Posted February 12, 2003 Author Posted February 12, 2003 Once again thanx Volte Face, it works perfectly Quote What I don't know keeps me excited...
sethindeed Posted February 12, 2003 Author Posted February 12, 2003 Actually, I can't refer to mdi.MDIChildren or MDIForm.MDIChildren Seems like MDiChildren is not a member of my collection :( Quote What I don't know keeps me excited...
sethindeed Posted February 12, 2003 Author Posted February 12, 2003 I am getting the following error : Object reference not set to an instance of an object Quote What I don't know keeps me excited...
*Experts* Volte Posted February 12, 2003 *Experts* Posted February 12, 2003 Well, assuming the code is in the MDI parent, you would use: Me.MDIChildren Quote
sethindeed Posted February 12, 2003 Author Posted February 12, 2003 Cool thx now it works ;) Quote What I don't know keeps me excited...
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.