otra versión ... con gdi+ .
function LightBorder( oGet,lfocus,lRounded )
local hDC := oGet:oWnd:GetDC()
local hBrush, hOldBrush, n
local aTopLeft, aBottomRight
local hPen1
local aRect := GetClientRect( oGet:hWnd )
local oGraphics := Graphics():New( hDC ) //Graphic-Object, High Quality is standard
local oPen
local nRed := nRGBRed( oget:ownd:nClrPane )
local nGreen := nRGBGreen( oget:ownd:nClrPane )
local nBlue := nRGBBlue( oget:ownd:nClrPane )
if lFocus
hPen1 = CreatePen( PS_SOLID, 1, nRGB( 102 , 175, 233 ) )
else
hPen1 = CreatePen( PS_SOLID, 1, nRGB( 180 , 180, 180 ) )
endif
SelectObject( hDC,hPen1)
aTopLeft = ClientToScreen( oGet:hWnd, { aRect[1], aRect[2] } )
aTopLeft = ScreenToClient( oGet:oWnd:hWnd, aTopLeft )
aBottomRight = ClientToScreen( oGet:hWnd, {aRect[3], aRect[4] } )
aBottomRight = ScreenToClient( oGet:oWnd:hWnd, aBottomRight )
SetBkMode( hDC , 1 )
if lRounded
RoundRect( hDC, aTopLeft[2]-4, aTopLeft[1]-2, aBottomRight[ 2 ]+3, aBottomRight[ 1 ]+2 , 7, 7 )
else
Rectangle( hDC, aTopLeft[1]-2, aTopLeft[2]-2, aBottomRight[ 1 ]+2, aBottomRight[ 2 ]+2 )
endif
DeleteObject( hpen1 )
for n = 1 to 10 // 10 es mejor
if lFocus
oPen := Pen():New( 255-n*25 , 214, 234, 249 , 1 , .T.)
else
oPen := Pen():New( 255 , nRed, nGreen, nBlue , 1 , .T.)
endif
open:setsize(1)
oGraphics:DrawRect( oPen, , aTopLeft[2]-n-4 , aTopLeft[1]-n-2, aBottomRight[ 2 ]- aTopLeft[2]+(n+3)*2 , aBottomRight[ 1 ]- aTopLeft[1]+ (n+2)*2 )
open:destroy()
next
oGraphics:destroy()
oGet:oWnd:ReleaseDC()
Return nil