ArchAngel Posted May 7, 2005 Posted May 7, 2005 Dim frm0 as frmMainMdi Dim frm1 As New frmAsset_new frm1.MdiParent = frm0 frm1.Show() Me.Close() Boys and Girls it is obvious that i am no genius but can anyone explain why i cannot frmAsset_new as a Mdi child under frm0 i. i seem to only to be able to do it using either the menu item click ..... with frm1.Mdiparent = me..... is there a variable i could use that will aloow me do this? thanks guys :confused: :confused: :confused: Quote
Administrators PlausiblyDamp Posted May 7, 2005 Administrators Posted May 7, 2005 Do you already have an instance of frmMainMdi open? If so you need to set the MdiParent to be the existing instance, in the code above you are creating a new instance and using that as the MDI parent. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
ArchAngel Posted May 8, 2005 Author Posted May 8, 2005 Yes i have an instance open...... The MDi parent is already open so i dont need to create a new instance of it. The problem seems to be using variables to reference the mdi parent i.e. frm1.mdiparent = frm0 if i was writting the code on the frmMainMdi it would not have this problem because i would not use a variable i would use "me" ,,,,, :confused: guys pls get back to me..... i am dieing here. Quote
Napivo1972 Posted May 9, 2005 Posted May 9, 2005 If this from you are opening the from from is a MIDIchild to your MDIForm the solution is easy. Dim frm1 As New frmAsset_new frm1.MdiParent = me.MdiParent frm1.Show() Me.Close() If not you�ll need a way to store the MDI parent in the form (create a property) and use that one for reference. 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.