using automationelement
, there way send clicks tabitem
without having move mouse , simulate clicks? automationelement
still new me - far understand it, unless supports invokepattern
(which tabitem not) have go route of locating control location , simulating mouse. have code working (see below) - curious if option.
automationelement tabcontrol = getcontrol(window, "notebook"); automationelement tabgeneral = getcontrol(tabcontrol, "fm_staff_sub_p1"); automationelementcollection tabs = getalltabs(window, tabgeneral); system.windows.point p = tabs[1].getclickablepoint(); movemouse((int)p.x, (int)p.y); clickmouse();
thank you.
- try
tab.setfocus()
- get supported patterns (
tab.getsupportedpatterns()
), see ones supported tab implementation. should support selectionitempattern, use:((selectionitempattern)tab.getcurrentpattern(selectionitempattern.pattern)).select()
- use
sendkeys
window in order navigate tabs (most cases have hot key navigate between them. can combine checking after each navigation if tab selected. - if above fail, guess mouse click option.