Results 1 to 18 of 18

Thread: How can you add the xp visual style to a vb.net application?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2000
    Posts
    1,195

    How can you add the xp visual style to a vb.net application?

    and how can you create an icon for it?
    whatever icon i choose, it compliles it having the default "white box" icon, but when the app opens up the icon shows on the taskbar, but the actual exe has no icon.. how can i fix this?

  2. #2
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    I think this topic has been asked previously in this forum - try doing a search in the forums to see if you can find out any information.

    This seems to be a common question - but sorry to say I haven't yet investigated it - so I have no code to share yet.

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    That's in VS.NET2003 . It's property you can set to : XPStyle (not sure of the right name)

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2000
    Posts
    1,195
    cant seem to find it.. no such property exists (looking in the form properties)

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by qpabani
    cant seem to find it.. no such property exists (looking in the form properties)
    Check you project Property Page (properties window) , there you can set the default icon for your application (exe) .

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2000
    Posts
    1,195
    i can change the icon, but it wont appear as the executable's icon in windows explorer - the default white box is there instead..

    and i cant find the xp style either

  7. #7
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Change the icon in project properties and the main form icon , then shut down your project , delete the exe file , run it again . It might help , although I changed the icon without any problems .

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Btw , are you running VS.NET2003 ? I've heard that XPStyle property is right there .I don't have it but the guys said that here .

  9. #9
    Member
    Join Date
    Sep 2002
    Posts
    53
    (vb.net 2003) yes if you open up the " Windows Form Designer generated code " region in your main form and add Application.EnableVisualStyles() directly after InitializeComponent() it does away with making the manifest file.

  10. #10
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Ahaa , Cool . So it's not visual property in the IDE ?

  11. #11
    Member
    Join Date
    Sep 2002
    Posts
    53
    I don't know of or can see any visual property in the IDE.

  12. #12
    Member
    Join Date
    Apr 2003
    Location
    CANADA
    Posts
    63

    hmmmmmm

    for visual studio .net 2003 >

    Code:
    #Region " Windows Form Designer generated code "
    
        Public Sub New()
            MyBase.New()
    
            'This call is required by the Windows Form Designer.
            InitializeComponent()
            Application.EnableVisualStyles() 'ADD THIS LINE!!!
    
            'Add any initialization after the InitializeComponent() call
    
        End Sub
    and set each control with a FlatStyle property to FlatStyle.System

    for visual studio .net 2002 >

    check THIS: might be helpful!!!

  13. #13
    Member
    Join Date
    Apr 2003
    Location
    CANADA
    Posts
    63
    Originally posted by Pirate
    Ahaa , Cool . So it's not visual property in the IDE ?
    er ... just a question ... the converter in ur sig can't convert projects to vs .net 2003 final :/

  14. #14
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by session
    er ... just a question ... the converter in ur sig can't convert projects to vs .net 2003 final :/
    Click it , you should firgure it out yourself .

  15. #15
    Member
    Join Date
    Apr 2003
    Location
    CANADA
    Posts
    63


    the build isn't final build!!!

  16. #16
    Fanatic Member
    Join Date
    Oct 1999
    Location
    England
    Posts
    982
    Apologies for bringing up this old thread but I don't like to start new threads unnecessarily.

    I was trying to follow a microsoft article http://msdn.microsoft.com/netframewo...ndowsforms.asp

    the problem was I was get the following
    -----------------------------------------------------------------------------
    Error while trying to run project:Unable to start debugging

    Unable to start program e:\vbdotnet\XPStyleExample.exe

    The application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem.
    ------------------------------------------------------------------------------

    So I did some searching and found this thread.
    I found what session said and added this line.
    Code:
    Application.EnableVisualStyles() 'ADD THIS LINE!!!
    Am I right in believing this line only works for VS.NET version 2003 and not the previous version?

    Does anyone know why my program wouldn't work with the manifest file?
    (A difficult question when you can't see my app infront of you).

    If I use the single line of code method and run the app on a W2K machine will it run OK?

    So many questions.

    Thanks for reading.

  17. #17
    Addicted Member PeteD's Avatar
    Join Date
    Jun 2003
    Location
    Sydney
    Posts
    158
    To make it work in the IDE, place a manifest file in:

    C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE

    (or wherever you're devenv.exe is)

    I have attatched the manifest file, but you will have to remove the .txt extension.
    Attached Files Attached Files

  18. #18
    Fanatic Member
    Join Date
    Oct 1999
    Location
    England
    Posts
    982
    Thanks PeteD, I shall try that in a mo.

    Anyone got any answers to my other questions?

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