I have a WinForms app, and I can't seem to access the text of a ToolStripStatusLabel
through UIAutomation. Microsoft implies that the support for StatusStrip
s (and presumably items within them) is limited, but this seems like a basic enough use case that it should work.
The control shows up with ControlType.Edit
in UISpy, and appears to just be read-only text box, however its value is always the same as its name, not its text.
The properties in UISpy are as follows:
AutomationElement
General Accessibility
AccessKey: ""
AcceleratorKey: ""
IsKeyboardFocusable: "False"
LabeledBy: "(null)"
HelpText: ""
State
IsEnabled: "True"
HasKeyboardFocus: "False"
Identification
ClassName: ""
ControlType: "ControlType.Edit"
Culture: "(null)"
AutomationId: "StatusBar.Pane0"
LocalizedControlType: "edit"
Name: "My Label"
ProcessId: "3972 (*****)"
RuntimeId: "42 134002 0"
IsPassword: "False"
IsControlElement: "True"
IsContentElement: "True"
Visibility
BoundingRectangle: "(9, 273, 79, 17)"
ClickablePoint: "48,281"
IsOffscreen: "False"
ControlPatterns
GridItem
Row: "0"
Column: "0"
RowSpan: "1"
ColumnSpan: "1"
ContainingGrid: ""status bar" "statusStrip""
Value
Value: "My Label"
IsReadOnly: "True"
Basically, I'm hoping for some way to go myLabel.Text = "something"
and be able to get that value out somehow through UIAutomation.