RichardKline
asked on
Passing startup parameters to child from MDI parent
First time using Multiple Document Interface Windows forms.
How does one pass startup parameters from the parent?
Including a URL with examples would be gratefully accepted.
Thank you.
How does one pass startup parameters from the parent?
Including a URL with examples would be gratefully accepted.
Thank you.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
what is the error?
have you set parent midcontainer property = true ?
have you set parent midcontainer property = true ?
or change the constructor as follows
Public Sub subform(ByVal param1 As String)
InitializeComponent()
Me.m_param1 = param1
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry that I could not respond earlier.
ghayasurrehman, Error = VS 2010's Intellisense objected with an "unknown constructor" error. But this parent code works fine with the subForm code as you presented it.
Dim NewChild As subform = New subform()
With NewChild
.subform("ThisParameter")
.MdiParent = Me
.Show()
End With
*************
jtoutou,
Very Cool. I knew that you could directcast to/from a child form's element (label, textbox) but that was much too limiting. Never thought about using Public Properties.
Thank you, Both!
ghayasurrehman, Error = VS 2010's Intellisense objected with an "unknown constructor" error. But this parent code works fine with the subForm code as you presented it.
Dim NewChild As subform = New subform()
With NewChild
.subform("ThisParameter")
.MdiParent = Me
.Show()
End With
*************
jtoutou,
Very Cool. I knew that you could directcast to/from a child form's element (label, textbox) but that was much too limiting. Never thought about using Public Properties.
Thank you, Both!
Very Welcome...
ASKER
Thank you.
PARENT (does not work).
Dim NewChild As subform = New subform("thisParameter")
With NewChild
.MdiParent = Me
.Show()
End With
SUBFORM
Public Class subform
Private m_param1 As String
Private Sub subform_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Public Sub subform()
InitializeComponent()
End Sub
Public Sub subform(ByVal param1 As String)
Me.m_param1 = param1
InitializeComponent()
End Sub
End Class