bug in common controls
- From: Bob Moore <bobm@xxxxxxxx>
- Date: Tue, 04 Mar 2008 12:05:47 +0000
I seem to have found a bug in the common control wrapped by CTreeCtrl.
Repro (VS2008, compiled and run on Vista):
1. Create a dialog-based native mode application.
2. Place a CTreeCtrl on the form.
3. Assign an icon which uses alpha-blending (i.e. it possesses
the characteristic of transparency) to an imagelist. Something
with about 25-30% transparency shows the effect well.
4. Associate the imagelist with the tree control.
5. populate the tree with some items which use the icon.
6. Hover the mouse over an item, repeatedly.
The problem seems to be a paint bug: the icon is being painted on top
of itself over and over again, without removing the previous instance,
so the transparency is gradually lost as the "layers" build up. The
apparent effect is a darkening of the icon. If you were using the
transparency to signify being disabled, youcan see how this would get
confusing...
Workarounds :
1. Disable the TVS_EX_FADEINOUTEXPANDOS extended style as shown in the
code below.
dwStyleBits = m_ctrl_treeAdapters.GetExtendedStyle();
dwStyleBits &= TVS_EX_FADEINOUTEXPANDOS;
m_ctrl_treeAdapters.SetExtendedStyle (0, dwStyleBits);
2. Use SetWindowTheme to change to Vista-style buttons.
Note that I have NOT used SetWindowTheme to set visual styles
consistent with Explorer because... well because the new tree styles
suck. I want the old + buttons. The problem only affects old-style
buttons : something fell through a testing hole here, by the look of
it.
I have looked in vain for somewhere to report this on Connect and
couldn't find it reported in MSDN, so decided to post here.
Bob Moore
http://bobmoore.mvps.org/
.
- Follow-Ups:
- Re: bug in common controls
- From: Bob Moore
- Re: bug in common controls
- From: David Lowndes
- Re: bug in common controls
- From: Joseph M . Newcomer
- Re: bug in common controls
- Prev by Date: Re: Killing a MMTimer
- Next by Date: Message Box is hidden behind the mainframe
- Previous by thread: MDI application embedded into DLL
- Next by thread: Re: bug in common controls
- Index(es):
Loading