Forum > RichMemo

[SOLVED] TRichMemo Background

(1/1)

Badger:
Is it possible to set a 'clear' background for a Rich Memo.

I have a Rich Memo over the top of an image and I want the user to be able to see the image behind with the text over the top. Setting the Rich Memo brush style to clear doesn't work and there is no canvas for Rich Memo.

skalogryz:
it's kinda yes, and kinda no :)

for Windows this what you might want to try:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---uses  ... Windows...; procedure TForm1.FormShow(Sender: TObject);var  l : Dword;begin  // Make sure that RichMemo1.Handle EXISTS! this operation HAS to be performed, if HANDLE is recreated  // Make sure there's TImage resides on the same form as RichMemo  l:= GetWindowLong(RichMemo1.Handle, GWL_EXSTYLE);  SetWindowLong(RichMemo1.Handle, GWL_EXSTYLE, l or WS_EX_TRANSPARENT);end; 

Badger:
Thanks that works fine. :)
One other question, I'm planning to make this application available for Apple system, is it possible to do this on Apple platforms?

skalogryz:

--- Quote from: Badger on August 27, 2021, 09:38:07 am ---One other question, I'm planning to make this application available for Apple system, is it possible to do this on Apple platforms?

--- End quote ---
in theory, yes, it is possible.
Yet, it will be a different kind of code.

skalogryz:
a new property has been added:
https://wiki.freepascal.org/RichMemo#Transparent
It works for Win32, Cocoa and Qt5.

Should make your cross-platform life a little-bit easier.

Navigation

[0] Message Index

Go to full version