Hello,
is there a way to create a button (be it push, bevel, etc.) with a transparent background and only the caption showing in whatever color?
Thank you
Hello,
is there a way to create a button (be it push, bevel, etc.) with a transparent background and only the caption showing in whatever color?
Thank you
If I am not mistaken , you can do this with the MBS plugins.
In pure Xojo, using a canvas is the simplest way to go. Use MouseUp as Action. Under Windows, it is pretty straightforward, as a couple of rectangles will do the trick.
Under Mac, you can use DrawInto to get the picture of a button (that can be placed off window) and make it transparent, here transparent blue :
[code]Sub Paint(g As Graphics, areas() As REALbasic.Rect) Handles Paint
dim p as new picture(PushButton1.width, PushButton1.height, 32)
PushButton1.Drawinto(p.graphics, 0, 0)
p.Transparent = 1
g.DrawPicture(p,0,0)
g.ForeColor = &c0080FFDE
g.FillRoundRect(0,0,g.width, g.height, 4, 4)
End Sub
[/code]
[quote=296205:@Armando SORBI]Hello,
is there a way to create a button (be it push, bevel, etc.) with a transparent background and only the caption showing in whatever color?[/quote]
Use a Label with the MouseDown and MouseUp events.
I think Gavin is right. Armando, you can mark that answer as correct.
Yes, I think Gavin’s solution is the simplest. Thank you
I thought you wanted a button with a transparent background. But if all you need is the text itself, Gavin has nailed it.