Hi,
How do I set a slider to a startup value when creating from a resource.
Regards
Gary
Hi,
How do I set a slider to a startup value when creating from a resource.
Regards
Gary

Thanks that works perfectly ![]()
I am giving an option of using gradients in my dialogue boxes and in the configuration screen want to display an example of what the customer will see as you do in your Backgrounds program. Have tried to display using btnbmp but does not seem to show any gradient. How did you achieve this?
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 NILWorks perfectly ![]()
Thanks for your help
Regards
Gary