Page 1 of 1

Can we Identify A new form by Its Control Name

Posted: Wed Jan 31, 2007 7:04 am
by arishahsan
I have to verify that the Opened form is the expected form or not and for that I am using the Control Name of the form but when I am using
NewForm = Application.FindFormTitle("FormTitle");
NewForm.FindControlName ("Control Name Of the New Form");
I am always getting null
so could u tell me how to verify a form by its Control Name

Posted: Wed Jan 31, 2007 8:49 pm
by webops
The function form.FindControlName searches the child control with the specified name in the form, but do not return the control name of the form. You can use the form.ControlName property only in the next version V1.1.0.

Use the ClassName property in V1.0.0 to verify the form:

Code: Select all

if (form.Text != "Form title" || form.ClassName != "Class name")
{
    Console.WriteLine("ERROR: invalid form ...");
    return 1;
}
Jenö