Page 1 of 1

Overloaded Form.Find functions with ControlId?

Posted: Fri Sep 08, 2006 3:49 pm
by k_huber
We use some old windows dialogs and search the controls with Form.FindControlId().
This function returns a generic control type and we must cast to the correct class:

Code: Select all

Control control = form.FindControlId(102);
if (control is RadioButton)
{
    RadioButton radio = (RadioButton)control;
    Mouse.MoveToControl(radio);
    radio.Checked = true;
}
It would be easier for us to use overloaded function like FindRadioButton (controlId).

Code: Select all

RadioButton radio = form.FindRadioButton(102);
if ( radio != null )
{
    Mouse.MoveToControl(radio);
    radio.Checked = true;
}

Posted: Sun Sep 10, 2006 12:07 am
by webops
An other user also asked for this functionality, so we implemented it for the next release.
In 0.9.3 every Form.Find function has an overloaded function with ControlId.

Jenö Herget
Ranorex Team