Results 1 to 5 of 5

Thread: Avoid Application.EnableVisualStyles()?

  1. #1

    Thread Starter
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690

    Avoid Application.EnableVisualStyles()?

    I recently read this
    In version 1.1 of the .NET Framework, Microsoft provided a Application.EnableVisualStyles() method that supposedly replaced the need for the above changes (.manifest file). Unfortunately, using this approach causes many run time exceptions and should be avoided!
    Anyone run into trouble using .EnableVisualStyles()?

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Re: Avoid Application.EnableVisualStyles()?

    I've been using it for quite a while with no exceptions, the only thing I did run into was a glitch that caused all graphics loaded into an ImageList at design time to not display on controls at runtime. Although that was easily resolved by calling DoEvents after EnableVisualStyles call.

  3. #3
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    Re: Avoid Application.EnableVisualStyles()?

    I had to disable it in my app because it was causing a vb6 activex control named Voloview that i use to display Autocad drawings, to cause an exception.

    Regards
    Jorge
    "The dark side clouds everything. Impossible to see the future is."

  4. #4

    Thread Starter
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690

    Re: Avoid Application.EnableVisualStyles()?

    Interesting. I haven't had problems myself, but yet to deploy a serious win form app. The quoted person above, I'm told, does his research thoroughly, just that I hadn't heard anything negative about it.

  5. #5
    New Member
    Join Date
    Jan 2005
    Posts
    10

    Re: Avoid Application.EnableVisualStyles()?

    here's a tip that worked for me.

    Go to your forms Windows generated code region and open it.

    Below Public Sub New(), MyBase.New() paste
    Application.EnableVisualStyles()

    and set Flat property of your controls to System.
    VBfan.com
    Non english site. Croatian Visual Basic.NET site.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width