please see the attached code:
Code: Select all
public static object OpenDropdownButton(System.Windows.Forms.Control control, object input)
{
DevExpress.XtraEditors.DropDownButton theButton = control as DevExpress.XtraEditors.DropDownButton;
theButton.ShowDropDown();
return null;
}
public static object showDropDownButtonContextMenu(this Ranorex.Button button)
{
Ranorex.Control control = button.Element.Parent.As<Ranorex.Control>();
control.InvokeRemotely(OpenDropdownButton);
return null;
}
and than i cast it into Ranorex.Control and perform control.InvokeRemotely(OpenDropdownButton)
which than execute the method on the UI control.
The thing i DON'T understand is why i have to do
Code: Select all
button.Element.Parent.As<Ranorex.Control>();
Code: Select all
button.As<Ranorex.Control>();
i would like to point out that the button is xpath in the repository is [Edit: i forgot to mention that this path is for the button and it sits under a higher level in the repository which contains the form]
Code: Select all
container[@controlname='panelClient']/container[@controlname='scMain']/container[@caption='Panel2']/container[@controlname='grpTerms']/element[@controlname='btnCreateTerm']/button[@accessiblename='Create']
Code: Select all
button.Element.Parent
also i have tried to define the button in the repository as an element (ommiting the button[@accessiblename='Create'] from Xpath) and than i taught i will not need to go to
Code: Select all
button.Element.Parent
Regards,
Tnimni