By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,695 Members | 1,310 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,695 IT Pros & Developers. It's quick & easy.

Visual Styles

P: n/a
I want to use visual styles in my app, but it is causing a problem with
a DLL I use. Is there a way to disable visual styles for that DLL? I do
not have access to the code for the DLL. The DLL's developer is aware
of the problem but will not have a fix ready in time for me.

Jun 12 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi,

As far as I know the visual stules are enabled for the whole application (or
at least per UI thread) you can't have some of the controls with enabled
visual styles and the other part not.

However I found that enabling visual stules from .NET cause problems some
times. It seems to work OK if the visual styles are enabled not form .NET
code, but by using manifest file.

Here you can find informarmation how to enable visual stules using manifest
files

http://msdn.microsoft.com/library/de...ndowsForms.asp

--

Stoitcho Goutsev (100)

<ML****@hotmail.com> wrote in message
news:11*********************@u72g2000cwu.googlegro ups.com...
I want to use visual styles in my app, but it is causing a problem with
a DLL I use. Is there a way to disable visual styles for that DLL? I do
not have access to the code for the DLL. The DLL's developer is aware
of the problem but will not have a fix ready in time for me.

Jun 12 '06 #2

P: n/a
You can call SetWindowTheme() (Interop call from uxtheme.dll) to disable
Visual Styles for a specific control. Pass String.Empty to the 2 string
Arguments to disable Visual Styles and null to re-enable.

[DllImport("uxtheme.dll")]
private static extern IntPtr SetWindowTheme(IntPtr hWnd, String
pszSubAppName, String pszSubIdList);

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
<ML****@hotmail.com> wrote in message
news:11*********************@u72g2000cwu.googlegro ups.com...
I want to use visual styles in my app, but it is causing a problem with
a DLL I use. Is there a way to disable visual styles for that DLL? I do
not have access to the code for the DLL. The DLL's developer is aware
of the problem but will not have a fix ready in time for me.

Jun 12 '06 #3

P: n/a
Thanks, Mick. I have tried SetWindowTheme. It does change the
appearance of the dialogs/controls created by the DLL, but the problem
persists. I think I need the visual styles disabled when the dialog is
created.

Any other ideas?

Jun 12 '06 #4

P: n/a
Without knowing anything about the dll or the problems you're encountering,
not really.

Have you tried placing a DoEvents() call after EnableVisualStyles() ?
Have you tried using a Manifest file instead of calling EnableVisualStyles()
?

Are you using VS2002, VS2003 or VS2005?

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
<ML****@hotmail.com> wrote in message
news:11**********************@j55g2000cwa.googlegr oups.com...
Thanks, Mick. I have tried SetWindowTheme. It does change the
appearance of the dialogs/controls created by the DLL, but the problem
persists. I think I need the visual styles disabled when the dialog is
created.

Any other ideas?

Jun 13 '06 #5

P: n/a
Thanks for the response.

The one part of the DLL that does not work is a color selection
control. It uses colored buttons that appear raised when selected. The
control will not let the user select a new color when visual styles are
used.

I am using DoEvents() and I have tried using a manifest instead of
EnableVisualStyles. I am using VS2005.

Could something like ActivationContext or AppDomain be used to control
the environment of a DLL? I am not real familiar with them.

Thanks,
Mike

Jun 13 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.