Hi,
I was looking for a way to make my butons, check boxes, radio buttons etc appear like they do in XP, however after searching around i found a way. Using a manifest file. This involved creating the file and adding it to the application and lots of other stuff.
I have found that just by simply adding a simple line of code into the 'Form1' code window it will do it anyway.
When you create a new application the code is as shown below.
Note: This is how it looks when you have "Windows Form Designer generated code" expanded.
CODE
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
Now by adding:
CODE
Application.EnableVisualStyles()
as shown below:
CODE
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
Application.EnableVisualStyles()
'Add any initialization after the InitializeComponent() call
End Sub
Provding you have the button Flatstyle set to "System" the controls will be displayed in whatever Theme the person who runs the .exe has set.
Now i may be stating the obvious and this is most likely the way to do it, but after searching around playing round with manifest files, (which worked) this seems like a much simpler option.
Can someone please correct me if i am wrong or if there are any flaws in this process.
Go easy, i'm a newbie.
Thanks.
This post has been edited by Martyr2: 1 Feb, 2008 - 11:38 AM