Overloaded Form.Find functions with ControlId?

Class library usage, coding and language questions.
k_huber
Posts: 2
Joined: Tue Jul 25, 2006 8:22 pm

Overloaded Form.Find functions with ControlId?

Post by k_huber » Fri Sep 08, 2006 3:49 pm

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;
}

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

Post by admin » Sun Sep 10, 2006 12:07 am

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