Can we Identify A new form by Its Control Name

Ask general questions here.
Posts: 26
Joined: Thu Jan 18, 2007 12:04 pm

Can we Identify A new form by Its Control Name

Post by arishahsan » Wed Jan 31, 2007 7:04 am

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

Site Admin
Site Admin
Posts: 350
Joined: Wed Jul 05, 2006 7:44 pm

Post by admin » Wed Jan 31, 2007 8:49 pm

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;