No announcement yet.

RichEdit Transparent Background

  • Filter
  • Time
  • Show
Clear All
new posts

  • RichEdit Transparent Background

    I'm doing some work with the RichEdit control and I've just come across something that seems relatively undocumented and is not supported by the current version of PB's A quick search of the forums also failed to turn up anything about it. I'm sure there are some gurus here that know this already, but I'd thought I'd share it for the rest of us.

    Giving the RichEdit control an extended style value of &H20 will make the background transparent. This only works with MSFTEDIT.DLL (RichEdit50W).

    I couldn't find a MS-defined constant name for this value, so I've modified my copy of as follows:

    %ES_EX_TRANSPARENT = &H00000020

    It opens up a world of possibilities for me. I came across this information here:

    If anyone has any more on this or any other RichEdit "secrets", I'd be interested to know.
    - LJ

  • #2
    This works in FireFly by setting WS_EX_TRANSPARENT which is the same value. The control isn't very useful though since it paints everything on top of each other.
    Mobile Solutions
    Sys Analyst and Development


    • #3
      Thanks Roger, can't say I noticed %WS_EX_TRANSPARENT - I've never had reason to use it for any other control. So maybe it's not quite as obscure as I thought! That's the trouble with working with out of date documentation (prior to MSFTEDIT.DLL a transparent background does not seem to be supported). I'll remove my modification and use %WS_EX_TRANSPARENT instead.

      It took me far too long to find this though. I tried SetBkMode without success before I came upon it. I was looking for it because, other than using a transparent background, there seems to be no alternative to just having a uniform background color over the whole control area. I am using a borderless RichEdit control laid over a graphic control which provides the margin area and the background, which can be plain color or a graphic. Or is there an easier way of doing this?
      - LJ