Qus:    How can we get the information from the form of a Dialog Box?
Nov 24, 2020 14:18 2 Answers Views: 90 DIVYA

By using the Form.ParentForm property of the dialog box we can access the public members of the form. And we can explicitly convert the reference returned by the ParentForm property to appropriate type.Below code will help us to demonstrate the ParentForm property to access a property from the form.

public void GetParent()

{

string x = ((Form1)this.ParentForm).Text;

}

Prev Next
Answers (2)
PARTH Nov 25, 2020 08:05
Answer:   Can you please refrain your question, it is not clear. What do you mean by the form of a Dialog Box?

TEJA Nov 25, 2020 08:13
Answer:   By using the Form.ParentForm property of the dialog box we can access the public members of the form. And we can explicitly convert the reference returned by the ParentForm property to appropriate type.Below code will help us to demonstrate the ParentForm property to access a property from the form.
public void GetParent()
{
string x = ((Form1)this.ParentForm).Text;
}

Post Your Answer
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let`s Connect