Use XP style without Manifest file?

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
 
D

Dragon

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
 
T

Terry Olsen

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top