Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
AutoXP Style
Author:
Steve Hunt
E-mail:
Click to e-mail author
Submitted:
2/16/2005
Version:
VB6
Compatibility:
VB6
Category:
Forms
Views:
16295
We have all seen how to make our VB6 applications use the XP style in place on our PC's, by using a Mainfest File. Add this code to your main form and it will not only use XP styles, but if the Manifest File is missing, it will be created.
Declarations:
Option Explicit Private Declare Function InitCommonControls Lib "comctl32.dll" () As Long
Code:
Private Sub Form_Initialize() Dim fso As Variant Dim FName As String FName = App.Path & "\" & App.EXEName & ".exe.Manifest" Set fso = CreateObject("Scripting.FileSystemObject") If Not fso.FileExists(FName) Then CreateManifest FName MsgBox "Did not find a Manifest file, so one has been created for you." _ & vbCrLf & "XP styles will be applied next time you run this application", _ vbOKOnly + vbInformation, "Application manifest file missing" Else InitCommonControls End If End Sub Private Sub CreateManifest(ByVal FilePathAndName As String) Dim ManifestFile As Integer ManifestFile = FreeFile Open FilePathAndName For Append As #ManifestFile Print #ManifestFile, "" Print #ManifestFile, "
" Print #ManifestFile, "
" Print #ManifestFile, "
You Application Name Here
" Print #ManifestFile, "
" Print #ManifestFile, "
" Print #ManifestFile, "
" Print #ManifestFile, "
" Print #ManifestFile, "
" Print #ManifestFile, "
" Close #ManifestFile End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement