Use XP style without Manifest file?

  • Thread starter Thread starter Lars Netzel
  • Start date Start date
L

Lars Netzel

How can I make my application use the XP style without having to add the
extra file called manifest file together with the exe?

best regards/
Lars Netzel
 
You can include manifest file in your assembly's Win32 resources, group
name — "RT_MANIFEST", ID — 1. It seems that you can't include custom
Win32 resources when compiling from IDE (correct me if I'm wrong), but
you can specify /win32resource:file.res option if compiling from command
line.

Hope this helps

Roman
 
I have always put the following code directly under the
Inherits System.Windows.Forms.Form
of the startup form. I have never had an exception thrown because of it
(knock on wood). Any other forms you show from the main form will also
be theme'd. Just make sure if a control has a FlatStyle property that
it is set to System.

<System.STAThread()> _
Public Shared Sub Main()
If OSFeature.Feature.IsPresent(OSFeature.Themes) Then
System.Windows.Forms.Application.EnableVisualStyles()
End If
System.Windows.Forms.Application.Run(New Form1)
End Sub 'Main
 
Back
Top