TRACKBAR

All questions regarding Windows programming, post here. API,COM, ActiveX, DirectX, OpenGL, MFC and so on...

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

TRACKBAR

Postby polle12 » Fri Dec 12, 2008 4:06 am

Hello!
Does anyone know how to change the size of the slider? I want to create a trackbar which reminds Windows volume setting (thin line & relatively big slider).
polle12
 
Posts: 5
Joined: Fri Dec 12, 2008 3:58 am

Postby MXP » Fri Dec 12, 2008 1:09 pm

I assume you're using Win32. If so you can just use SetWindowPos() or MoveWindow() to set the size of the trackbar control.
Need information on a function I've posted? Chances are it's at the MSDN.
MXP
 
Posts: 6506
Joined: Mon Sep 22, 2003 5:27 pm

Postby polle12 » Mon Dec 15, 2008 2:28 am

Yes I'm using Win32, but the problem is that I don't want to change the size of the whole window. I just want to modify my trackbar by making the thumb bigger or the channel thinner. Like here (first example window):

msdn.microsoft.com/fi-fi/library/bb760149(en-us,VS.85).aspx
polle12
 
Posts: 5
Joined: Fri Dec 12, 2008 3:58 am

Postby MXP » Mon Dec 15, 2008 2:38 pm

Apart from drawing it yourself, it looks like you can only change the size of the slider by specifying TBS_FIXEDLENGTH when you create it and using TBM_SETTHUMBLENGTH to set the size of the slider.
Need information on a function I've posted? Chances are it's at the MSDN.
MXP
 
Posts: 6506
Joined: Mon Sep 22, 2003 5:27 pm

Postby polle12 » Tue Dec 16, 2008 8:00 am

Now I have a slider that looks good. With TBM_SETTHUMBLENGTH message one can change the size of the thumb, but in my case it didn't work, because I had specified TBS_ENABLESELRANGE. This style also makes the channel bigger and my problem was solved by removing it. :huh:
polle12
 
Posts: 5
Joined: Fri Dec 12, 2008 3:58 am

Postby MXP » Tue Dec 16, 2008 12:41 pm

TBS_ENABLESELRANGE changes the size of the channel so that the user can see which part of the channel is selected. If you dont need the user to select a range then you dont want to use that style.
Need information on a function I've posted? Chances are it's at the MSDN.
MXP
 
Posts: 6506
Joined: Mon Sep 22, 2003 5:27 pm


Return to Windows Programming

Who is online

Users browsing this forum: Google Adsense [Bot] and 3 guests