Results 1 to 5 of 5

Thread: how to make WinXP Style Buttons/Other things?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2005
    Posts
    67

    how to make WinXP Style Buttons/Other things?

    hey all, basically the question is the topic, but here is another explanation:
    how do i using windows XP style for a buttons in vb.net?
    plz some code would be nice..
    btw, i tryed the 101 tutorials(where there is such tutorial) but i still dont understand how the hell it works :P

  2. #2
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: how to make WinXP Style Buttons/Other things?

    If you are using a Sub Main to start your app do this:

    VB Code:
    1. Module Module1
    2.     Public Sub Main()
    3.         Application.EnableVisualStyles()    ' Enables XP Visual styles
    4.         Application.DoEvents()              ' and events
    5.         Dim frm As New frmParent
    6.         Application.Run(frm)
    7.     End Sub
    8. End Module

    If you are not using Sub Main then in the Constructor of your form:
    VB Code:
    1. Public Sub New()
    2.         MyBase.New()
    3.         Application.EnableVisualStyles()    ' Enables XP Visual styles
    4.         Application.DoEvents()              ' and events
    5.         'This call is required by the Windows Form Designer.
    6.         InitializeComponent()
    7.  
    8.         'Add any initialization after the InitializeComponent() call
    9.  
    10.     End Sub

    You need to put the these two lines of code:
    Application.EnableVisualStyles() ' Enables XP Visual styles
    Application.DoEvents() ' and events
    before everything else.

  3. #3
    Member
    Join Date
    Oct 2005
    Location
    C:\Downloads at 87.105.109.239
    Posts
    39

    Re: how to make WinXP Style Buttons/Other things?

    If you even use EnableVisualStyles, some of controls will be shown in XPStyle but some not... The controls that have FlatStyle property will be shown normally. Then you have to set FlatStyle property to System. (EnableVisualStyles must be invoked anyway).

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: how to make WinXP Style Buttons/Other things?

    Also note that there are certain limitations in the visual style support in VS.NET 2003, e.g. no images on Buttons and no support for UpDown controls. For a full list of these limitations and a way to fix them, visit the Skybound VisualStyles link in my signature.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,374

    Re: how to make WinXP Style Buttons/Other things?

    Check out the DevExpress Editors Library here:

    DevExpress Editors Library

    These controls use a "LookAndFeel" property which can be set globally to change the appearance of all controls used from the library throughout a given project (including forms). You can select from many skins including WinXP look and feel. Makes .NET programs look very professional and they provide good support as well.

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