Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CSliderCtrl(TrackBars) and TBS_DOWNISLEFT/TBS_REVERSED

187 views
Skip to first unread message

Ann-Marie Ratcliffe

unread,
Jan 18, 2002, 8:00:18 AM1/18/02
to
In an SDI MFC application, I have two Vertical CSliderCtrls on the right of
my CFrameWnd (currently placed there via a CSplitterWnd, although that will
change). I need there to run from 0 at the bottom, to 63 at the top.
Personally, that would seem to be the right way for the slider to look
vertically anyway, but for some reason the TrackBar common control seems to
think that it should run the other way round, with 0 at the top, and 63 at
the bottom.

Looking though the CSliderCtrl options, Icouldn't find any obvious solution,
but when I looked into the Windows Common Controls, I found the solution -
or so I thought. Adding the TBS_DOWNISLEFT style on creation should do the
job. And apparently there was even a TBS_REVERSED style which I could check
to confirm the reversal.

Unfortunately, VC++(6.0 Enterprise SP5) does seem to have heard about
TBS_DOWNISLEFT or TBS_REVERSED. It just complains about undeclared
identifiers. I considered #defining the identifier myself, but I can't find
any indication of what the message value should be set to.

Has anyone else come across this problem, or know how to resolve it?

If necessary, I'll write my own slider control (and probably make it a lot
more intelligent and user/developer-friendly. But it seems a waste not to
use a ready made control, which suggests it can work as I require.

Yours with thanks in advance,

A Ratcliffe
aratc...@archimagic.co.uk

Although I will check the newsgroup regularly for replies, I would
appreciate an e-mail response in addition to the newsgroup response if
possible (I'll get it quicker).

Jeff Partch

unread,
Jan 18, 2002, 8:58:31 PM1/18/02
to
"Ann-Marie Ratcliffe" <aratc...@archimagic.co.uk> wrote in message
news:1011358403.21089....@news.demon.co.uk...

You probably need to update your platform SDK headers and libraries. The ones that ship with VC6 are
several years old and AFAIK the VC service packs don't touch them. The place to go for this is...

http://www.microsoft.com/msdownload/platformsdk/sdkupdate/

But otherwise the defines are...

#if (_WIN32_IE >= 0x0500)
#define TBS_REVERSED 0x0200
#endif

#if (_WIN32_IE >= 0x0501)
#define TBS_DOWNISLEFT 0x0400
#endif

...but note that by using these style bits you are limiting the platforms that your app will be able
to run on. I'll leave the impact of this up to you, but the details are found here...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/Shell/versions.asp

HTH,

Jeff...
--
Please post all follow-ups to the newsgroup only.

Ann-Marie Ratcliffe

unread,
Jan 20, 2002, 1:22:54 AM1/20/02
to
Thanks for the assistance, Jeff. On the one hand, you've solved the problem,
and on the other you've pushed me where I was going before I discovered
CSliderCtrl/TrackBar's short comings. I think I'll be writing my own
user/developer-friendly version of a slider control. As soon as its finished
I'll stick it on the Web.

Thanks again,

A Ratcliffe
aratc...@archimagic.co.uk

P.S. Is www.codeguru.com the best place to put the developed control, or are
there better places?

0 new messages