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

ImageList when EnableVisualStyles()

4 views
Skip to first unread message

Jacob Anderson

unread,
Jul 29, 2003, 12:12:11 PM7/29/03
to
Hello,

When I use the Application.EnableVisualStyles() method
call, my image lists no longer provide images correctly
to the controls that use them. For instance, if I assign
the images to a TreeView, the nodes no longer show the
images (only a blank area where the image should appear).

If I do not use Application.EnableVisualStyles() the
application works as expected and my tree nodes have
images.

Is there some special work that I need to do for the
ImageList to work properly with other controls when
using "EnableVisualStyles"?

I am running .NET 1.1 on Windows XP using VS.NET 2003.

Thanks

-- Jake
j...@beyond-ordinary.com

Jay B. Harlow [MVP - Outlook]

unread,
Jul 29, 2003, 12:32:28 PM7/29/03
to
Jacob,
The general workaround for the quirkiness of EnableVisualStyles is to follow
the call to EnableVisualStyles with a call to DoEvents:

Application.EnableVisualStyles
Application.DoEvents
Application.Run

Hope this helps
Jay

"Jacob Anderson" <j...@beyond-ordinary.com> wrote in message
news:01af01c355ec$2aecca30$a101...@phx.gbl...

Alan Pretre

unread,
Jul 29, 2003, 12:33:39 PM7/29/03
to
"Jacob Anderson" <j...@beyond-ordinary.com> wrote in message
news:01af01c355ec$2aecca30$a101...@phx.gbl...
> When I use the Application.EnableVisualStyles() method
> call, my image lists no longer provide images correctly
> to the controls that use them.

Yes, there is a bug in EnableVisualStyles(). Put a DoEvents() call
immediately after the EnableVisualStyles() call.

-- Alan


0 new messages