c# - Sending clicks to an AutomationElement with no InvokePattern -


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.

  1. try tab.setfocus()
  2. get supported patterns (tab.getsupportedpatterns()), see ones supported tab implementation. should support selectionitempattern, use: ((selectionitempattern)tab.getcurrentpattern(selectionitempattern.pattern)).select()
  3. use sendkeys window in order navigate tabs (most cases have hot key navigate between them. can combine checking after each navigation if tab selected.
  4. if above fail, guess mouse click option.