易截截图软件、单文件、免安装、纯绿色、仅160KB

用VB实现带图片的XP风格的按钮控件

    虽然在VB里实现XP风格很简单,但是要使用XP风格同时又让按钮显示图片,则实现起来要麻烦一些,为此,我写了一个控件来实现前述功能,同时让读者可以从中了解XP主题界面的绘制过程。
    使用办法很简单,在VB里新建一个工程,然后添加一个控件模块,粘贴以下代码,再将控件放置到窗口即可,当然,可别忘设置图片和文字属性,具体代码如下:
'* ************************************************** *
'* 模块名称:CommandButtonEx.ctl
'* 模块功能:带图片的XP风格的按钮控件
'* 编码:lyserver
'* 联系方式:http://blog.csdn.net/lyserver
'* ************************************************** *
Option Explicit
'----------------------------------------------------
'API声明
'----------------------------------------------------
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type SIZE
cx As Long
cy As Long
End Type
Private Enum THEMESIZE
TS_MIN '// minimum size
TS_TRUE '// size without stretching
TS_DRAW '// size that theme mgr will use to draw part
End Enum
Private Declare Function OpenThemeData Lib "uxtheme.dll" (ByVal hwnd As Long, ByVal pszClassList As Long) As Long
Private Declare Function CloseThemeData Lib "uxtheme.dll" (ByVal hTheme As Long) As Long
Private Declare Function DrawThemeBackground Lib "uxtheme.dll" (ByVal hTheme As Long, ByVal lHDC As Long, ByVal iPartId As Long, ByVal nStateId As Long, pRect As RECT, pClipRect As RECT) As Long
Private Declare Function DrawThemeParentBackground Lib "uxtheme.dll" (ByVal hwnd As Long, ByVal hdc As Long, prc As RECT) As Long
Private Declare Function GetThemePartSize Lib "uxtheme.dll" (ByVal hTheme As Long, ByVal hdc As Long, ByVal iPartId As Long, ByVal nStateId As Long, prc As RECT, ByVal eSize As Long, psz As SIZE) As Long
Private Declare Function GetThemeBackgroundContentRect Lib "uxtheme.dll" (ByVal hTheme As Long, By


相关文档:

VB 简单计算器

Option Explicit
Dim potflag As Integer      '标识是否用小数点
Dim numcol As Integer       ' 点击运算符的个数
Dim LastInput               ' 指示上一次操作的内容
Dim colflag ......

VB怎样判断、防止程序重复执行

Private Sub Form_load()
    '判断程序是否已经运行
    If App.PrevInstance
Then
     MsgBox "本程序已经运行!", vbInformation Or vbOKOnly, "提示信息"
     Unload
Me
     Exit Sub
&n ......

c# 验证码组件 可vb,asp,net调用

      今天公司要求用C#写个验证码组件,让asp可以调用,在网上找了一堆资料,终于给我给搞出来了,因为本人第一次写组件,也是第一次发表文章,所有可能说的不是很好,大家请见谅。
      csdn上有这么篇文章,想学习写组件的可以去看看:http://blog.csdn.net/KimmKi ......

VB读取注册表

Private Type SECURITY_ATTRIBUTES
   nLength As Long
   lpSecurityDescriptor As Long
   bInheritHandle As Boolean
End Type
Dim lang As String
Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hkey As Long, ByV ......

VB 实现国际化

1. 利用资源文件保存国际化列表
2.“外接程序”--“外接程序管理器”--“VB6 资源编辑器”就可以编辑资源文件
3.部分代码
  '窗体加载
Private Sub Form_Load()
Dim LocaleID As Long
  LocaleID = GetSystemDefaultLCID
  Select Case LocaleID
   '英文 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号