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. :)
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.
Fantastic, works fine now. Thanks