System UI Automatisierung. Keine Zeilen in der Tabelle findenC#

Ein Treffpunkt für C#-Programmierer
Guest
 System UI Automatisierung. Keine Zeilen in der Tabelle finden

Post by Guest »

Ich versuche programmgesteuert einige Tabellenzeilen von einer Windows -Anwendung mit System.Windows.Automation In einer C# -Konsole -App. In einem Dialog. Ich verwende Windows Accessibility Insight, die die Zeile finden und mir die Baumstruktur anzeigen kann. Die einzigen Kinder, die ich unter der Tabelle gefunden habe, sind die Bildlaufleiste und ihre Schaltflächen. Br/> Die Gittersteuerung:

Die Zeile:
< /p>
Code: < /p>

Code: Select all

  static void Main(string[] args)
{
var appWindow = AutomationElement.RootElement.FindFirst(
TreeScope.Children,
new PropertyCondition(AutomationElement.NameProperty, appName));

if (appWindow != null)
{
// Find the dialog
var dialog = appWindow.FindFirst(TreeScope.Descendants,
new PropertyCondition(AutomationElement.NameProperty, "Plotdata - Test"));

if (dialog != null)
{
var tables = dialog.FindAll(TreeScope.Descendants, new
PropertyCondition(AutomationElement.ControlTypeProperty,
ControlType.Table));

if (tables != null)
{
foreach (AutomationElement table in tables)
{
Console.WriteLine(table.Current.Name);
Console.WriteLine(table.Current.ControlType.ProgrammaticName);

AutomationElementCollection rows =
table.FindAll(TreeScope.Descendants,
new PropertyCondition(AutomationElement.ControlTypeProperty,
ControlType.Custom)); //The row is ControlType.Custom. Also
tried common table items types
}
}
}
}
}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post