Ranorex

Overloaded Form.Find functions with ControlId?

 
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet
View previous topic :: View next topic  
Author Message
k_huber



Joined: 25 Jul 2006
Posts: 2

PostPosted: Fri Sep 08, 2006 4:49 pm    Post subject: Overloaded Form.Find functions with ControlId?
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: click into code to enlarge
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: click into code to enlarge
RadioButton radio = form.FindRadioButton(102);
if ( radio != null )
{
    Mouse.MoveToControl(radio);
    radio.Checked = true;
}
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Sun Sep 10, 2006 1:07 am    Post subject:
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
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum