xp.bas

来自「串口通讯。上位机实例.提供了良好的界面。对初学者很有参考性」· BAS 代码 · 共 35 行

BAS
35
字号
Attribute VB_Name = "modXP"
'本工程中的xp.res可以直接加入其他工程进行编译以使其具备XP风格
'注意加入资源文件时要同时加入本模块,  设置工程从Sub Main()启动,否则无初始化过程
'InitCommonControls函数存在于comctl32.dll(版本5)中,不建议使用,而要使用InitCommonControlsEx
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
Sub Main()
   InitCommonControlsVB
   Form1.Show
'  FrV.Show
'   FrV2.Show
'  Form2.Show
End Sub



⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?