I have the application, which shows the dialog window to let user to edit item's properties.
It is important to be sure that predefined control on this dialog is focused.
The following code is used to find the dialog window:
Code: Select all
Container dlg=null;
Element field=null;
string path="/form/element[@class='_MY_WINDOW_CLASS_']/container[@accessiblename~'^MyPrefix.*']";
if (Host.Local.TryFindSingle(path,10000,out dlg))
{
if (dlg.TryFindSingle("bla-bla-bla",10000,out field)
{
EnsureFocused(field); <--see below
}
}
When I get the dialog's container and the field instances (I've got them always, that's not a problem), I perform checking of the focus:
Code: Select all
void EnsureFocused(Element item)
{
while(Item.HasFocus==false)
{
item.Focus();
Delay.Milliseconds(100);
}
}
May I ask You, please, to help me to solve this problem?