Slider Control

Started by Jonathan Bristow, November 11, 2006, 11:14:32 AM

Previous topic - Next topic

Jonathan Bristow

Does anyone know how i can set the Slider Position at the Form_create stage?
Reading back the nPosition is easy in the hscroll callback.  :)

TechSupport

Hi Jonathan,

The initial slider position can be set using the "Value" property at design time (you probably already know that). :)

You can set the values in the WM_CREATE message handler as follows (This sets a slider with min 1, max 10 and a position of 5.

   SendMessage hWndControl, %TBM_SETRANGE, %TRUE, MakDwd(1,10)
   SendMessage hWndControl, %TBM_SETPAGESIZE, 0, 1
   SendMessage hWndControl, %TBM_SETLINESIZE, 0, 1
   SendMessage hWndControl, %TBM_SETTICFREQ, 1, 1
   SendMessage hWndControl, %TBM_SETPOS, %TRUE, 5


The above may look familiar because I cut and pasted it directly from the code that FireFly generates for the Form.

Jonathan Bristow

Fantastic, works fine now. Thanks