1

I have to use TStaticText instead of TLabel to make my software friendly to screen-readers because TStaticText has window handle and TLabel does not.

However, even though TStaticText has Transparent property, it is not really transparent on a gradient background.

Can anyone recommend way how to make it transparent or perhaps how to make a simple custom component which would be compatible with screen readers (having window handle that is) and be transparent at the same time?

Coder12345
  • 3,431
  • 3
  • 33
  • 73
  • I guess you need to override default handling of `WM_ERASEBACKGROUND`. – Free Consulting Mar 01 '15 at 01:22
  • 1
    You might be better to make a TLabel derivative that was friendly to automation. That way you'd know how to do same for other non Win32 controls. It does astonish me that VCL (and presumably FMX) still doesn't support automation. – David Heffernan Mar 01 '15 at 07:55
  • @DavidHeffernan Actually FMX has support for Accessibility - look here - http://docwiki.embarcadero.com/RADStudio/XE6/en/FireMonkey_Accessibility_Package . How would you go about making TLable friendly to automation? – Coder12345 Mar 01 '15 at 13:40
  • 1
    Wow, a rare win for FMX! ;-) There's a really good answer here on SO from Remy Lebeau on the subject of adding accessibility to a vcl control. A search should yield it. Or find Remy's top answers. – David Heffernan Mar 01 '15 at 13:54
  • 1
    Ok, it's here: http://stackoverflow.com/questions/16320914/creating-accessible-ui-components-in-delphi/16322828#16322828 – David Heffernan Mar 01 '15 at 13:55
  • Windows needs to have themes enabled for the transparency of TStaticText to work. – Johan Jun 07 '17 at 12:51

0 Answers0