Search code examples
c#winformsaccessibilitytablelayoutpanelnaturallyspeaking

MSAA -- Dragon Cannot Interact with TableLayoutPanel


I am modifying a Winforms application to be accessible via Dragon Professional 15. I have also recently added support for screen readers (including JAWS and MAGic) so the application has been, for the most part, reviewed in order to ensure that the AccessibleName (and, where appropriate, AccessibleRole) property is filled out.

Dragon does fairly well with most of this application but there are parts with which it utterly fails to operate. After a lot of trial and error, I was able to determine that the cause of the problem was the use of TableLayoutPanels in my application. Any control that resides in a TableLayoutPanel is not consumable by Dragon (ie. when I speak the AccessibleName value, Dragon cannot find the control). As an example, the button in this document tree works just fine in the following configuration:

working document configuration

(NB: The noFocusCueButton class derives from Button and has only minor changes concerning visual aspects of the class.)

In this configuration, I can speak the AccessibleName of the noFocusCueButton and Dragon will recognize it and click it. However, as soon as I move to this configuration:

broken document configuration

...Dragon can no longer detect and interact with the noFocusCueButton. I have searched for some property on the TableLayoutPanel that might explain this but I do not see anything obvious. I have also searched for other people encountering this problem but have not come up with anything. Any SO experts out there know anything about this?


Solution

  • In what can only be described as "the story of my life", I found the problem in less than a few minutes after posting the question (though I had spent hours on it beforehand).

    Evidently, at some point, the AccessibleRole property of the TableLayoutPanel had been set to List. Setting it back to Default fixed the problem.