![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
FormParent load opens FormChildA. FormChildA btn click opens FormChildB. (FormChildA and FormChildB are both children of FormParent) (FormChildA and FormChildB are different forms) Problem: FormChildA btn click can only open one instance for FormChildB. I need multiple instances of FormChildB. Any suggestions or ideas please. tx, Paul |
#3
| |||
| |||
|
|
in FormChildA button click: Dim newFormB as New FormChildB newFormB.Show -Rob Teixeira [MVP] "Paul Mars" <paulmarsREMOVE (AT) netzero (DOT) com> wrote in message news:OFpEX09LEHA.3012 (AT) tk2msftngp13 (DOT) phx.gbl... FormParent load opens FormChildA. FormChildA btn click opens FormChildB. (FormChildA and FormChildB are both children of FormParent) (FormChildA and FormChildB are different forms) Problem: FormChildA btn click can only open one instance for FormChildB. I need multiple instances of FormChildB. Any suggestions or ideas please. tx, Paul |
#4
| |||
| |||
|
|
your newFormB would then not be a child. It needs to be child of FormParent. The original FormChildB and FormChildA are both declared in FormParent. FormChildB is module level Public Shared |
#5
| |||
| |||
|
|
Dim newFormB as New FormChildB newFormB.MDIParent = FormParent newFormB.Show -Rob Teixeira [MVP] "Paul Mars" <paulmarsREMOVE (AT) netzero (DOT) com> wrote in message news:O3nhN%23%23LEHA.1032 (AT) tk2msftngp13 (DOT) phx.gbl... your newFormB would then not be a child. It needs to be child of FormParent. The original FormChildB and FormChildA are both declared in FormParent. FormChildB is module level Public Shared |
#6
| |||
| |||
|
|
This will not work Rob. If I put this in ChildB, it would not recognize "FormParent". Also, generally why make a second dim for multiple instances? My code: |
#7
| |||
| |||
|
|
This will not work Rob. If I put this in ChildB, it would not recognize "FormParent". |
|
Also, generally why make a second dim for multiple instances? |
|
My code: Public Class FormParent Inherits System.Windows.Forms.Form Windows Form Designer generated code Public Shared childBInst As New childB Private Sub OpenChildA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenChildA.Click Dim childAInst As New childA With childAInst .MdiParent = Me .Show() .Text = "1st" End With childBInst.MdiParent = Me End Sub End Class ------------------------------------- Public Class childA Inherits System.Windows.Forms.Form Windows Form Designer generated code Private Sub OpenChildB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenChildB.Click with FormParent.childBInst .Show() .Text = "2nd" End With End Sub End Class "Rob Teixeira [MVP]" <RobTeixeira@@msn.com> wrote in message news:ONUfMg$LEHA.3012 (AT) tk2msftngp13 (DOT) phx.gbl... Dim newFormB as New FormChildB newFormB.MDIParent = FormParent newFormB.Show -Rob Teixeira [MVP] "Paul Mars" <paulmarsREMOVE (AT) netzero (DOT) com> wrote in message news:O3nhN%23%23LEHA.1032 (AT) tk2msftngp13 (DOT) phx.gbl... your newFormB would then not be a child. It needs to be child of FormParent. The original FormChildB and FormChildA are both declared in FormParent. FormChildB is module level Public Shared |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
"Paul Mars" <paulmarsREMOVE (AT) netzero (DOT) com> schrieb This will not work Rob. If I put this in ChildB, it would not recognize "FormParent". Also, generally why make a second dim for multiple instances? My code: Of course it doesn't recognize FormParent, but I think it's still the same MDIParent, so you can also use the same MDIParent: Dim newFormB as New FormChildB newFormB.MDIParent = Me.MDIParent newFormB.Show -- Armin How to quote and why: http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html |
#10
| |||
| |||
|
|
Hi Paul, In this thread is everytime a new instance of an form created in the samples. I showed you withouth doing that. The way I did it was create them shared in the mdi container. Keep in mind that what is showed in this thread is a totally different approache from what I showed. (I showed it you only because you did ask to make it able to open form3 in form2 by the way, wherein I showed you that you can show and hide it everywhere) When you do not take the approach I took, there is in my opinon also no need to create the form shared in my opinion, however keep than in mind that the information on the form will also everytime in default new state. Cor |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |