473,668 Members | 2,408 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multiple childs in MDIParent

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
Nov 20 '05 #1
26 1946
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

"Rob Teixeira [MVP]" <RobTeixeira@@m sn.com> wrote in message
news:Ot******** *******@tk2msft ngp13.phx.gbl.. .
in FormChildA button click:

Dim newFormB as New FormChildB
newFormB.Show

-Rob Teixeira [MVP]

"Paul Mars" <pa************ @netzero.com> wrote in message
news:OF******** ******@tk2msftn gp13.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


Nov 20 '05 #2
in FormChildA button click:

Dim newFormB as New FormChildB
newFormB.Show

-Rob Teixeira [MVP]

"Paul Mars" <pa************ @netzero.com> wrote in message
news:OF******** ******@tk2msftn gp13.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

Nov 20 '05 #3
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

"Rob Teixeira [MVP]" <RobTeixeira@@m sn.com> wrote in message
news:Ot******** *******@tk2msft ngp13.phx.gbl.. .
in FormChildA button click:

Dim newFormB as New FormChildB
newFormB.Show

-Rob Teixeira [MVP]

"Paul Mars" <pa************ @netzero.com> wrote in message
news:OF******** ******@tk2msftn gp13.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


Nov 20 '05 #4
Dim newFormB as New FormChildB
newFormB.MDIPar ent = FormParent
newFormB.Show

-Rob Teixeira [MVP]

"Paul Mars" <pa************ @netzero.com> wrote in message
news:O3******** **********@tk2m sftngp13.phx.gb l...
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

Nov 20 '05 #5
Dim newFormB as New FormChildB
newFormB.MDIPar ent = FormParent
newFormB.Show

-Rob Teixeira [MVP]

"Paul Mars" <pa************ @netzero.com> wrote in message
news:O3******** **********@tk2m sftngp13.phx.gb l...
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

Nov 20 '05 #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:
Public Class FormParent

Inherits System.Windows. Forms.Form

Windows Form Designer generated code

Public Shared childBInst As New childB

Private Sub OpenChildA_Clic k(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles OpenChildA.Clic k

Dim childAInst As New childA

With childAInst

..MdiParent = Me

..Show()

..Text = "1st"

End With

childBInst.MdiP arent = Me

End Sub

End Class

-------------------------------------

Public Class childA

Inherits System.Windows. Forms.Form

Windows Form Designer generated code

Private Sub OpenChildB_Clic k(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles OpenChildB.Clic k

with FormParent.chil dBInst

..Show()

..Text = "2nd"

End With

End Sub

End Class

"Rob Teixeira [MVP]" <RobTeixeira@@m sn.com> wrote in message
news:ON******** ******@tk2msftn gp13.phx.gbl...
Dim newFormB as New FormChildB
newFormB.MDIPar ent = FormParent
newFormB.Show

-Rob Teixeira [MVP]

"Paul Mars" <pa************ @netzero.com> wrote in message
news:O3******** **********@tk2m sftngp13.phx.gb l...
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


Nov 20 '05 #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_Clic k(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles OpenChildA.Clic k

Dim childAInst As New childA

With childAInst

..MdiParent = Me

..Show()

..Text = "1st"

End With

childBInst.MdiP arent = Me

End Sub

End Class

-------------------------------------

Public Class childA

Inherits System.Windows. Forms.Form

Windows Form Designer generated code

Private Sub OpenChildB_Clic k(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles OpenChildB.Clic k

with FormParent.chil dBInst

..Show()

..Text = "2nd"

End With

End Sub

End Class

"Rob Teixeira [MVP]" <RobTeixeira@@m sn.com> wrote in message
news:ON******** ******@tk2msftn gp13.phx.gbl...
Dim newFormB as New FormChildB
newFormB.MDIPar ent = FormParent
newFormB.Show

-Rob Teixeira [MVP]

"Paul Mars" <pa************ @netzero.com> wrote in message
news:O3******** **********@tk2m sftngp13.phx.gb l...
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


Nov 20 '05 #8
"Paul Mars" <pa************ @netzero.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.MDIPar ent = Me.MDIParent
newFormB.Show

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #9
"Paul Mars" <pa************ @netzero.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.MDIPar ent = Me.MDIParent
newFormB.Show

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1864
by: Maarten | last post by:
Hi all, I' facing a problem here that i am stucked with since i started with.net in vb6.0 i used for example Form1.txtName.text = "test" in vb.net i used DirectCast(Me.MdiParent, Form1).txtName.text = "test" and in C# i use ? i have a settingsform where users can make changes of in and output's
1
305
by: Paul Mars | last post by:
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.
7
3100
by: Siv | last post by:
Hi, I have an MDI application that uses a generic "ShowPage" routine in a module that is called when I want to display a child form. The basic idea is that in the module I have declared each form as follows: Friend F0 As frmMain Friend F1 As frmStart Friend F2 As frmSearch Then in my ShowPage routine (which is passed a string "pageToShow" which is the name of the form I wish to open), I first check to see if we already have an instance...
2
2910
by: Prabhudhas Peter | last post by:
If I click a menu to open a form which already open...the vb.net opens a new window while existing open window is there...i want to restric the opening of a new instance of an already opened form... and also ... if i open a form from a child form of an MDI form, the recently opened form also should be the child of that MDI form... -- Peter...
9
4623
by: Quina | last post by:
Hi. Is there someone that can tell me how can I have multiple screens on the the same form, displaying only on at the time? Thank you all for any replys. João Carias
1
1269
by: Stampede | last post by:
Hello, I created a Windows Application Project and tried to create a MDI-based application. So I created a new MDI-parent with the creation wizzard. Then I created a default form and tried to make it a MDI-child of the parent I just created, but I didn't find an entry in the properties dialog which would the form make a MDI-child. Can someone explain to me how to add MDI-childs? greetings
7
1598
by: mabond | last post by:
Hi Can't get my head round something which I reckon should be simple. My app has a main form (frmMain). MdiContainer set to true. A menu item triggers a new form (frmSelect) whose parent is frmMain Button on frmSelect triggers a new form (frmReport) whose parent also needs to be frmMain When frmReport loads and displays I don't want user to see frmSelect, but I
6
1711
by: Kevin | last post by:
I've got an mdiParent form. I open an instance of a child form like this: Dim frmChild as New frmCustomers frmChild.Show() I've got a few of these open at a time. On each frmChild I open another form that displays customer data. When I make changes and save the customer data, I need the updated data to show on the correct frmChild. How do I know which form opened the customer data form and
0
8462
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8382
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8586
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7405
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2792
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1787
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.