Hi,
I am dynamically creating a BTNBMP (not from resource) to a window and I can't make it transparent. However, if I do it from a Resource dialog, it works. How can I do it without using a Resource dialog?
This one works for a Resource dialog:
REDEFINE BTNBMP oBTN RESOURCE "TEST" OF oDLG NOBORDER
oBTN:LTRANSPARENT:=.T.
However this one doesn't : (displays bitmap but not transparent)
@100,100 BTNBMP oBTN RESOURCE "TEST" SIZE 280,110 OF oWND NOBORDER
oBTN:LTRANSPARENT:=.T.
Thanks
Bert
How to make a TBTNBMP transparent
-
- Posts: 10
- Joined: Mon Mar 05, 2007 11:18 pm
- Location: Southern California
-
- Posts: 10
- Joined: Mon Mar 05, 2007 11:18 pm
- Location: Southern California
More
I am using a BRUSH in my window thats why I want the BTNBMP to be trasparent.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Bert,
Here you have a working sample:
Please notice the use of the clause TRANSPARENT when defining the dialog too
Here you have a working sample:
Code: Select all
// Testing a transparent TBtnBmp on a transparent DialogBox
#include "FiveWin.ch"
function Main()
local oBru, oDlg, oBtn
DEFINE BRUSH oBru FILENAME "../bitmaps/Backgrnd/beach.bmp"
DEFINE DIALOG oDlg SIZE 400, 200 BRUSH oBru TRANSPARENT
@ 70, 80 BTNBMP oBtn FILENAME "../bitmaps/yes.bmp" ;
SIZE 50, 30 OF oDlg NOBORDER ACTION MsgInfo( "click" )
oBtn:lTransparent = .T.
ACTIVATE DIALOG oDlg CENTERED
return nil
-
- Posts: 10
- Joined: Mon Mar 05, 2007 11:18 pm
- Location: Southern California
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: