Results 1 to 5 of 5

Thread: VB.NET 2003 but Application.EnableVisualStyles() doesn't work [RESOLVED]

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    210

    Unhappy VB.NET 2003 but Application.EnableVisualStyles() doesn't work [RESOLVED]

    i have vb.net 2003, and i wanted to have xp look on my app. so i did a search and found out that if i had 2003, i could just put Application.EnableVisualStyles() under InitializeComponent().

    so this is what i have:
    VB Code:
    1. #Region " Windows Form Designer generated code "
    2.  
    3.     Public Sub New()
    4.         MyBase.New()
    5.  
    6.         'This call is required by the Windows Form Designer.
    7.         InitializeComponent()
    8.         Application.EnableVisualStyles()
    9.         'Add any initialization after the InitializeComponent() call
    10.  
    11.     End Sub
    12. ...
    13. ...

    but that didn't do anything. i just used manifest and had a button and a progressbar on a form, and the progressbar had the xp look but the button had the classic look.

    i have no idea why Application.EnableVisualStyles() or only the progressbar had the change in looks. can anyone help me out?

    EDIT:

    hmm. odd. i opened a different project and used Application.EnabledVisualStyles() and it worked.. but only the progressbar and tabs. buttons, radiobutton, check boxes stayed the same. oh the scrollers changed too.

    is this normal?
    Last edited by nahya^^; Mar 10th, 2004 at 10:34 PM.

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    210
    here is a screenshot. only some controls have the xp look.
    Attached Images Attached Images  

  3. #3
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Some controls will not have the xp look, but for the others like the button you have to set flatstyle to system.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    210
    ahh. thanks. that worked.
    now i remember reading something about changing something to system. bleh.

  5. #5
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    If you are using Toolbars, the you will need to add

    Application.Doevents

    otherwise the buttons will not appear.

    Yes it is a bug and known by microsoft.

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