Lazarus

Free Pascal => Beginners => Topic started by: torbente on January 19, 2021, 01:40:58 am

Title: TSpeedButton in front of Tmemo impossible?
Post by: torbente on January 19, 2021, 01:40:58 am
I just found something very curious:

I dropped a TMemo to show some info, and on it upper rigth corner i try to place a TSpeedbutton to close it. The TMemo is always on top, so the button is not visible and you can not close the tmemo. I try many ways but was impossible: sending tmemo to back, bringing speedbutton to front, using the object inspector...

Then i try with a TButton. It worked as expected, IN FRONT of the Tmemo.

Why the TSpeedButton can not appear in front of a tmemo?
Title: Re: TSpeedButton in front of Tmemo impossible?
Post by: jamie on January 19, 2021, 02:38:45 am
Speedbutton is a TGraphicsControl and depends highly on a parent to accept it..
The TMemo in windows has its own window and does not play well to offer up a canvas !

 Not saying it can't be done because it can be with a little trickery


 You need to use controls that are  hosted from a TWinControl which has handles.

 If you want to use a Tspeedbutton still then place it inside a TPanel . have the Panel on top of the memo.
Title: Re: TSpeedButton in front of Tmemo impossible?
Post by: torbente on January 19, 2021, 02:53:15 am
Good to know that, thanks a lot.
A bitbutton can be used to0, and is more graphic friendly  ::)
TinyPortal © 2005-2018