Home All Groups Group Topic Archive Search About

TreeView with XP themes error

Author
29 Jun 2005 11:03 AM
JB
When I enable XP themes using EnableVisualStyles(), the treeview control on
my form displays an old style 3D scrollbar when the form loads if items are
added to the treeview at design time.

Does anybody know a workaround?

Regards
JB
Author
29 Jun 2005 12:59 PM
Herfried K. Wagner [MVP]
"JB" <gatulatsofthomedotcom> schrieb:
> When I enable XP themes using EnableVisualStyles(), the treeview control
> on my form displays an old style 3D scrollbar when the form loads if items
> are added to the treeview at design time.
>
> Does anybody know a workaround?

Add the items at runtime.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Are all your drivers up to date? click for free checkup

Author
29 Jun 2005 2:09 PM
Mick Doherty
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:uw0HjpKfFHA.584@tk2msftngp13.phx.gbl...
> "JB" <gatulatsofthomedotcom> schrieb:
>> When I enable XP themes using EnableVisualStyles(), the treeview control
>> on my form displays an old style 3D scrollbar when the form loads if
>> items are added to the treeview at design time.
>>
>> Does anybody know a workaround?
>
> Add the items at runtime.
>

....or resize the treeview at form load (set width to 0 then reset).

A nasty workaround I know, but you shouldn't actually see it resize.

Author
29 Jun 2005 4:49 PM
Herfried K. Wagner [MVP]
Mick,

"Mick Doherty"
<EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> schrieb:
>>> When I enable XP themes using EnableVisualStyles(), the treeview control
>>> on my form displays an old style 3D scrollbar when the form loads if
>>> items are added to the treeview at design time.
>>>
>>> Does anybody know a workaround?
>>
>> Add the items at runtime.
>
> ...or resize the treeview at form load (set width to 0 then reset).
>
> A nasty workaround I know, but you shouldn't actually see it resize.

Great trick :-).

Hopefully we will see this problem fixed in the final release of .NET 2.0:

<URL:http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=42983f95-9cfd-4616-9744-e6d3766c40e9>

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>

Bookmark and Share