Skip navigation.

You are not Welcome

Leave me alone.

XPStyle for VB6

,


Ai hay lập trình VB6 điều biết nó có giao diện khá xấu, y như win98 trở về trước. Vậy để có giao diện như XP hãy làm theo 2 bước sau:

Bước 1: bạn dùng notepad hay 1 trình văn bản nào đó soạn thảo file nội dung sau:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">    <assemblyIdentity 
        version="1.0.0.0" 
        processorArchitecture="X86" 
        name="CompanyName.ProductName.YourAppName" 
        type="win32" />
    <description>Your application description here</description>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity 
                type="win32" 
                name="Microsoft.Windows.Common-Controls" 
                version="6.0.0.0" 
                processorArchitecture="X86" 
                publicKeyToken="6595b64144ccf1df" 
                language="*" />
        </dependentAssembly>
    </dependency>
</assembly>

và lưu lại với tên theo dạng sau: tên ứng dụng của bạn.exe.manifest

Bước 2: Trong Project bạn đang làm việc, tạo thêm 1 file module đặt tên là XPStyle (hoặc tên gì tùy ý)
nhập vào nội dung sau:

Private Type tagInitCommonControlsEx
   lngSize As Long
   lngICC As Long
End Type
Private Declare Function InitCommonControlsEx Lib "comctl32.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
   ' Ensure CC available:
   With iccex
       .lngSize = LenB(iccex)
       .lngICC = ICC_USEREX_CLASSES
   End With
   InitCommonControlsEx iccex
   InitCommonControlsVB = (Err.Number = 0)
   On Error Goto 0
End Function

Public Sub Main()
   InitCommonControlsVB

   '   
   ' Start your application here:
   ' Ex: form1.show
   ' 

End Sub

Sau đó cho chương trình của bạn khởi động từ Sub Main() trước tiên.
Sau khi biên dịch ra file .exe cùng thư mục với file .manifest

Download chương trinh mẫu:

Snap Your Screen...Bóng ma trong đường ống áp lực

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies

Download Opera, the fastest and most secure browser
December 2009
M T W T F S S
November 2009January 2010
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31