• 0

[C#] Accesing properties on a parent (MDI Forms)


Question

2 answers to this question

Recommended Posts

  • 0

Yes. Use the MdiParent property of your child form to access the parent form. You can use any public or internal members, but not private or protected, just like normal (Y) If you want to make the textbox's data available publicly, you'll have to create a property or method to access the parent form's textbox.

// C#
public string MyText
{
 ? ?get
 ? ?{
 ? ? ? ?return this.TextBox1.Text;
 ? ?}
 ? ?set
 ? ?{
 ? ? ? ?this.TextBox1.Text = value;
 ? ?}
}

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.