Utilizar:
Code: Select all
DEFINE DIALOG frmPDV RESORCE 'TELAPDV' TRANSPARENT
Utilizar:
Code: Select all
DEFINE DIALOG frmPDV RESORCE 'TELAPDV'; frmPDV:lTrasparent:=.t.
Yo uso la opción PellesC transparente y además no funciona.
Code: Select all
DEFINE DIALOG frmPDV RESORCE 'TELAPDV' TRANSPARENT
Code: Select all
DEFINE DIALOG frmPDV RESORCE 'TELAPDV'; frmPDV:lTrasparent:=.t.
Code: Select all
function SetTrans( oDlg )
SetWindowLong( oDlg:hWnd, GWL_EXSTYLE, nOr( GetWindowLong( oDlg:hWnd, GWL_EXSTYLE ), WS_EX_LAYERED ) )
SetLayeredWindowAttributes( oDlg:hWnd,,, LWA_COLORKEY )
return nil
Code: Select all
oDlg:nOpacity := 180
Antonio Linares wrote:Puedes hacerlo asi:
ACTIVATE DIALOG oDlg ON INIT SetTrans( oDlg )
...
Code: Select all
function SetTrans( oDlg ) SetWindowLong( oDlg:hWnd, GWL_EXSTYLE, nOr( GetWindowLong( oDlg:hWnd, GWL_EXSTYLE ), WS_EX_LAYERED ) ) SetLayeredWindowAttributes( oDlg:hWnd,,, LWA_COLORKEY ) return nil
Code: Select all
#include "FiveWin.ch"
Function Main()
local oGet, cSeguridad:=Space(12), ide:=Space(10)
local oBrush, para
Define Brush oBrush COLOR nRGB( 255, 106, 0 )
Define Dialog oDlgC ResName "demo" Brush oBrush TRANSPARENT
ReDefine Get oGet var ide id 101 of oDlgC
ReDefine Get oGet var cSeguridad id 102 of oDlgC
ReDefine Button id 201 of oDlgC
ReDefine Button id 202 of oDlgC;
Action (oDlgC:End())
oDlgC:lHelpIcon:=.f.
Activate Dialog oDlgC Center;
On Init( Dialogo:= getwindowlong( oDlgC:hWnd, -20 ), ;
setwindowlong( oDlgC:hWnd, -20, nOr( Dialogo, 524288 ) ) , ;
setlayeredwindowattributes( oDlgC:hWnd, 0, 230, 2 ) ) // El parametro 230
oBrush:End() // es el nivel de transparencia
Return Nil // el el tope maximo es 255 entre
// Menor seal este numero mas trasnparente sera
DLL32 function getwindowlong( hwnd as LONG, index as LONG ) AS LONG PASCAL FROM "GetWindowLongA" lib "user32.dll"
DLL32 function setwindowlong( hwnd as LONG, index as LONG, newlog as LONG ) AS LONG PASCAL FROM "SetWindowLongA" lib "user32.dll"
DLL32 function setlayeredwindowattributes( hwnd as LONG, crkey as LONG, alpha as WORD, flag as LONG ) AS LONG PASCAL FROM "SetLayeredWindowAttributes" lib "user32.dll"
Code: Select all
#include "FiveWin.ch"
function Main()
local oDlg
DEFINE DIALOG oDlg
oDlg:nOpacity = 100
ACTIVATE DIALOG oDlg CENTERED
return nil
Antonio Linares wrote:Nixbeau,
Como ha comentado Anserkk, esta es la forma correcta para establecer un cierto nivel de transparencia:
Code: Select all
#include "FiveWin.ch" function Main() local oDlg DEFINE DIALOG oDlg oDlg:nOpacity = 100 ACTIVATE DIALOG oDlg CENTERED return nil
Antonio Linares wrote:Te refieres a que solo quieres que el fondo sea transparente ?
Puedes mostrar un dibujo de como quieres que se vea ?
Antonio Linares wrote:Prueba a usar un Brush NULL:
DEFINE BRUSH oBrush STYLE NULL
DEFINE DIALOG oDlg BRUSH oBrush ...
...
Code: Select all
DEFINE DIALOG oDlg COLOR CLR_BLACK,RGB(1,1,1)
<...... place all controls ....>
oDlg:nSeeThroClr := RGB(1,1,1)
ACTIVATE DIALOG oDlg
Perfecto nageswaragunupudi, muy bueno. Funcionó a la perfección.nageswaragunupudi wrote:Code: Select all
DEFINE DIALOG oDlg COLOR CLR_BLACK,RGB(1,1,1) <...... place all controls ....> oDlg:nSeeThroClr := RGB(1,1,1) ACTIVATE DIALOG oDlg