|
-
Jan 19th, 2010, 04:09 PM
#1
Thread Starter
New Member
[RESOLVED] MDI Child and a Dialog form
Hello all,
I'm having trouble with MDI child and a dialog form. The problem details are listed below:
1. One MDI Parent form (Form1) with a button on it (Button1).
2. One Child form of Form1 (name = Form2) with a button (Button2) and a textbox (text_box1).
3. Another form in the project (not child of Form1 and not MDI Parent) with name Form3. This form has also a button on it (Button3).
The application behaviour is as follows: the application starts with Form1. Clicking the Button1 will show Form2. Form2 correctly opened as a MDI child. Clicking the Button2 on the Form2 will show Form3 as dialog (Form3.ShowDialog() ). Clicking the Button3 on the Form3 need to do the magical thing - to set/change the text in the Form2's text_box1.
Tried various examples from this forum. Also followed a lot of examples from net. Nothing works. Tried to create a writable property in the Form2 class but calling it from the Form3 does nothing.
I tried to access the MDIchildren(ss) while ss loops in MDIchildrens array but I don't know how to access the label control inside the Form2 using this technique. Successfully changed the Form2 caption but no controls are available in VB intellisense - practically correct because VB don't know which form from array I'm referring to.
Could you please help me with this task? I'm not an experienced programmer but I don't want to skip the MDI section without this.
Regards,
Costin
-
Jan 19th, 2010, 04:27 PM
#2
Re: MDI Child and a Dialog form
Code:
Public Class Form3
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
CType(Form1.ActiveMdiChild, Form2).TextBox1.Text = "Hello"
Me.Close()
End Sub
End Class
-
Jan 19th, 2010, 04:53 PM
#3
Thread Starter
New Member
Re: MDI Child and a Dialog form
Actually... it's working! Thank you very much.
A short question. If I call the dialog using Form3.ShowDialog(me) will ensure that every time the active mdi child is form2? Or by simply launch the Form3 from Form2 button (Button2) will define Form2 as Active MDI Child? Translating this: last focused MDI child is the active mdi child?
Regards,
Costin
-
Jan 19th, 2010, 05:16 PM
#4
Re: MDI Child and a Dialog form
Last focused MDI child is the active MDI child, that's correct, yes.
-
Jan 19th, 2010, 05:33 PM
#5
Thread Starter
New Member
Re: MDI Child and a Dialog form
Thank you very much for your prompt responses.
-
Aug 19th, 2010, 03:59 PM
#6
Junior Member
Re: [RESOLVED] MDI Child and a Dialog form
Hi,
I am unable to make a child form dialog in VB.Net. Below code does not work?
SoftwareLic.MdiParent = Main
SoftwareLic.ShowDialog()
Any help? Thanks!
-
Aug 20th, 2010, 04:15 AM
#7
Junior Member
Re: [RESOLVED] MDI Child and a Dialog form
Hi Guys,
What I am trying to do is to keep the child dialog inside the parent container. I found C# example on this link below:
http://www.codeproject.com/KB/dialog...ed_dialog.aspx
-
Aug 20th, 2010, 08:55 AM
#8
Re: [RESOLVED] MDI Child and a Dialog form
Please don't hijack a resolved thread. Start a new one instead. Here's a site that will translate C# code into VB.
http://www.developerfusion.com/tools.../csharp-to-vb/
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|