Hi,
How do I set a slider to a startup value when creating from a resource.
Regards
Gary
// Result Control-Image oBMP
// Blanc = any Dummy-Bmp from Resource
// D_DIRECT ( 1 or 2 ) = Horiz. or Vertical ( I need numeric )
// D_COLOR1 = 1. Color
// D_COLOR2 = 2. Color
// D_MOVE = Grad-position from Slider
// -------------------------------------------------------
REDEFINE BITMAP oBMP ID 12 ADJUST RESOURCE "Blanc" OF oFld:aDialogs[1]
oBMP:bPainted := {|hDC| DS_GRAD( oBMP, D_DIRECT, D_COLOR1, ;
D_COLOR2, D_MOVE ) }
//------------- GRADIENT HOR / VERT -----------
FUNCTION DS_GRAD( oBitmap, nDirection,nVColor, nBColor, nMove )
LOCAL aGrad := { { nMove, nVColor, nBColor }, { nMove, nBColor, nVColor } }
LOCAL aRect := GETCLIENTRECT( oBitmap:hWnd )
LOCAL oNewBrush, hDC := oBitmap:GETDC()
IF nDirection = 1
DEFINE BRUSH oNewBrush COLOR GradientFill( hDC, 0, 0, aRect[3], aRect[4], aGrad, .T. )
ELSE
DEFINE BRUSH oNewBrush COLOR GradientFill( hDC, 0, 0, aRect[3], aRect[4], aGrad, .F. )
ENDIF
FillRect( hDC, aRect, oNewBrush:hBrush )
oBitmap:ReleaseDC()
RELEASE BRUSH oNewbrush
RETURN NIL
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 60 guests