Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6984901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:36:35+00:00 2026-05-27T18:36:35+00:00

I am developing a program which uses visual styles. The Main method looks like

  • 0

I am developing a program which uses visual styles. The Main method looks like this:

[STAThread]
static void Main() {
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    Application.Run(new Form());
}

The program also works as a plugin of another application and it is started, in this case, via COM. The problem is that the calling application (the COM client) doesn’t call EnableVisualStyles and it is out of my control. In this case the program is started as follows:

public static void StartAsPlugin() {
   Application.EnableVisualStyles();
   Form form = new Form();
   form.ShowDialog();
}

When the program is started as a plugin the progress bars and the combo boxes are not rendered with the same style they have when the program is started normally, while buttons, check boxes and radio buttons are OK.
Is there a way to force the visual style? I’ve tried with a manifest but with no luck!
Here is the manifest that I tried:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    version="1.0.0.0"
    processorArchitecture="*"
    name="RealApp"
    type="win32"
/>
<description>Your application description here.</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="*"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>

I think that the manifest is embedded correctly because ildasm shows the following in the manifest section:

.mresource public RealApp.RealApp.exe.manifest
{
  // Offset: 0x000004F0 Length: 0x0000029B
}

Thanks,
Stenio

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:36:36+00:00Added an answer on May 27, 2026 at 6:36 pm

    In the words of Raymond Chen, a plugin is a guest in the host process, and shouldn’t be changing the carpets.

    http://blogs.msdn.com/b/oldnewthing/archive/2010/04/30/10004931.aspx

    There is no way to turn them on because it is not really something you should be doing.

    If the host process does not want to use visual styles you probably shouldn’t be using them. Consider allowing your plugin to render without visual styles when hosted in an application without visual styles.

    Otherwise, see @Ken’s advice above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently developing a program that uses C#'s Dictionary container (specifically, SortedDictionary). This
I am developing a program where I find myself doing this like this a
I am developing a large program which uses a lot of memory. The program
Im currently developing a program that uses a scrollable/zoomable image as the main user
I'm developing a small haskell program that uses an external static library I've developed
I'm developing a matlab program in which I uses polygons(concave or convex). I need
I am developing an application in java for a mobile platform. The program uses
I am developing an application which uses file upload. My client uses Symantec End
I'm developing a program which allows users to input some information which then gets
I am developing some program in C# which will send the mail using outlook

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.