原文自http://bbs.csdn.net/topics/20421621。
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const BS_LEFT As Long = &H100&
Private Sub Form_Load()
Dim TempLng As Long
TempLng = GetWindowLong(Command1.hWnd, GWL_STYLE)
TempLng = TempLng Or BS_LEFT
SetWindowLong Command1.hWnd, GWL_STYLE, TempLng
End Sub
本文介绍如何使用VBScript编程语言通过Windows API函数GetWindowLong和SetWindowLong来修改命令按钮的样式,实现将按钮位置设置为左对齐。
2万+

被折叠的 条评论
为什么被折叠?



