Page 1 of 1

Btnbmp with a line

Posted: Thu Jan 09, 2025 12:44 pm
by Silvio.Falconi
is it possible to create a dividing line between the image and the text in a btnbmp?

example

Image


if there is no image the text must be in the center without the line

Image

I saw that if I upload an image on a white background the button then puts the text on a gray background
Any solution ?

Re: Btnbmp with a line

Posted: Thu Jan 09, 2025 1:14 pm
by Antonio Linares
Dear Silvio,

1. You can modify the Class TBtnBmp source code

2. You may try to use oBtnBmp:bPainted

Re: Btnbmp with a line

Posted: Thu Jan 09, 2025 1:35 pm
by Silvio.Falconi
Antonio Linares wrote: Thu Jan 09, 2025 1:14 pm Dear Silvio,

1. You can modify the Class TBtnBmp source code

2. You may try to use oBtnBmp:bPainted
I was inclined to go with the second option but
the problem is that if the text is bigger you should make the image smaller to give more prominence to the text

Re: Btnbmp with a line

Posted: Thu Jan 09, 2025 1:42 pm
by Antonio Linares
You may use a TPanel object and paint what you need...

Re: Btnbmp with a line

Posted: Thu Jan 09, 2025 9:48 pm
by Silvio.Falconi
Antonio Linares wrote: Thu Jan 09, 2025 1:42 pm You may use a TPanel object and paint what you need...
Resolved
although maybe I should calculate the length of the caption
oImage:bpainted:= { |hDC| MyLine(hDC,{oImage:nBottom - 50, 1,oImage:nWidth,147 },RGB(195,195,185),RGB(195,195,185)) }


Image

Re: Btnbmp with a line

Posted: Fri Jan 10, 2025 7:23 am
by Antonio Linares
Dear Silvio,

You are a FWH Master already :wink: