|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
请教各路高手:如何用:CreateRoundRectRgn函数来制作窗体?
源码如下:
Private Declare function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long Private Declare function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long Private Declare function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub UserForm_Click() Unload Me End Sub
Private Sub UserForm_Initialize() Dim RH As Long Dim x, y x = Me.Width + 50 y = Me.Height + 50 RH = CreateRoundRectRgn(3, 22, x, y) WinWnd = FindWindow(vbNullString, Me.Caption) '获取窗口句柄 SetWindowRgn WinWnd, RH, True End Sub
但是运行的时候,系统老是提示:调用DLL约定错误,请问是怎么回事?该如何修改?
|
|