|
-
Nov 10th, 2005, 11:12 AM
#1
Thread Starter
Lively Member
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
-
Nov 10th, 2005, 11:20 AM
#2
Frenzied Member
Re: how to make WinXP Style Buttons/Other things?
If you are using a Sub Main to start your app do this:
VB Code:
Module Module1
Public Sub Main()
Application.EnableVisualStyles() ' Enables XP Visual styles
Application.DoEvents() ' and events
Dim frm As New frmParent
Application.Run(frm)
End Sub
End Module
If you are not using Sub Main then in the Constructor of your form:
VB Code:
Public Sub New()
MyBase.New()
Application.EnableVisualStyles() ' Enables XP Visual styles
Application.DoEvents() ' and events
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
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.
-
Nov 10th, 2005, 03:07 PM
#3
Member
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).
-
Nov 10th, 2005, 06:58 PM
#4
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.
-
Nov 11th, 2005, 10:21 PM
#5
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|