Why can't you get the XP style look when you run or compile your Visual Basic application anyway? For your information, the Windows XP Visual Styles are provided by ComCtl32.dll version 6 or later. The ComCtl32 does not apply the latest styles to the client area of an application by default. So, in order to enable it, you need to ensure that your application is linked to the new ComCtl32.dll by calling the ComCtl's InitCommonControls API call. And then, you also need to provide a Manifest file which specifies that the new version of the control styles should be used.
To make this short. All you need to add to your code is this lines of codes on a module...
Private Type tagInitCommonControlsEx
lSize As Long
lICC As Long
End Type
Private Declare Function InitCommonControlsEx Lib "comctl3
2.dll" _
(iccex As tagInitCommonControlsEx) As Boolean
Private Const ICC_USEREX_CLASSES = &H200
Public Function InitCommonControlsVB() As Boolean
On Error Resume Next
Dim iccex As tagInitCommonControlsEx
With iccex
.lSize = LenB(iccex)
.lICC = ICC_USEREX_CLASSES
End With
InitCommonControlsEx iccex
InitCommonControlsVB = (Err.Number = 0)
On Error Goto 0
End Function
Public Sub Main()
' Call the function before other codes
InitCommonControlsVB
'
' Start your application here:
'
End Sub
Then add this text in a text file...
< ?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
< assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
Home »
Visual basic
,
Windows XP
,
XP Style
» How to Add XP Visual Style to your Visual Basic Application
How to Add XP Visual Style to your Visual Basic Application
Related Posts:
How to Add XP Visual Style to your Visual Basic ApplicationWhy can't you get the XP style look when you run or compile your Visual Basic application anyway? For your information, the Windows XP Visual Styles a… Read More
0 comments:
Post a Comment