1

For MFC controls that have a scrollbar such as CListCtrl and CEdit, why is so ridiculously hard to customize the looks of the scrollbar?

In XP MFC, we can get WM_NCPAINT and perhaps somehow change drawing of the scrollbar, but as I have noticed in other forums, these controls are "fight back" when you try to custom draw the scrollbar. So, not even professional MFC coders will attempt that, let alone novices like me.

With WindowsCE, we don't even get WM_NCPAINT messages.

The suggestions given is always to write your own control from scratch with CWnd. What is the point of having a framework, then? Ok, there's more benefits like messaging system, bla bla bla, but customizing look and feel I believe is important for product differentiation. While I understand that Windows would like every program to look-and-feel the same, I think they overdid it this time. iOS and Android wins here, where generally we still have roughly the same look-and-feel among apps (the controls behave as expected), but skinning the controls to their liking still works.

Ok, enough ranting. The question now becomes ... are there any alternatives to starting from scratch?

Ryuu
  • 779
  • 11
  • 22

3 Answers3

2

The short answer: no.

The slightly longer answer: The MFC controls are NOT their own thing, really. They're just minimal wrappers around the controls provided by Windows itself. And, as you have noticed, Win32 doesn't have provision for user-drawn scroll bars. They just aren't designed for it.

mjfgates
  • 3,351
  • 1
  • 18
  • 15
  • Yup, MFC is pretty much just a wrapper, so usually it MFC and Win32 is viewed as one of the same. But it's the "they just aren't designed for it" that doesn't make sense to me. It is designed with minimal UI elements and expecting 3rd party frameworks (e.g. Java Swing, QT) to work on top of it? Also, how does Macintosh (pre iOS) does it? Is that world as limiting? – Ryuu Mar 31 '12 at 13:18
  • Windows' scroll bars were designed in 1983-4, to run on 8088-based computers with as little as 256k of ram. There has never been significant demand for user-drawn scroll bars, so they have never added the functionality. The Mac's system scroll bars, I do not know about; it's been twenty years since I coded on Mac OS. – mjfgates Apr 06 '12 at 16:29
2

I agree with you...I eventually manage to do it by using this article. If you want give it a try...good luck!

Community
  • 1
  • 1
Javier De Pedro
  • 2,219
  • 4
  • 32
  • 49
  • This looks promising. While he gave the example in CListCtrl, I hope the same method will work in CEdit. I would vote up this post, but I don't have enough reputation points :) – Ryuu Apr 02 '12 at 01:03
  • Don't worry. I don't need the votes...I just try to help becouse other people helped me. Good luck again! – Javier De Pedro Apr 02 '12 at 07:04
0

I am a happy user of Xtreme Toolkit Pro (MFC) - http://www.codejock.com/products/toolkitpro/. They have a skin framework that might work for you. Yes this is commercial. But I don't have any personal gain in recommending them.

Gautam Jain
  • 6,789
  • 10
  • 48
  • 67
  • Please be aware that this toolkit comes with an annual subscription and that the solution will not work in case of an ActiveX that will be used as a plug-in, simply because the skin will impose itself on the containing application as well, which is not what you want. – Koen Oct 31 '12 at 15:15
  • But the OP is not talking about ActiveX, plug-in etc. Annual subscription is not mandatory unless you wish to upgrade. – Gautam Jain Nov 01 '12 at 15:15