gzy 发表于 2003-10-28 11:12:00

[VBA]麻烦各位帮忙

想创建一特殊形状的窗体,但是运行的时候提示"找不到DLL的入口点createellipticrgn gdi 32 ",我对于这些还不大清楚,是不是VB安装有问题啊
Option Explicit
Private Declare Function createellipticrgn Lib "gdi32" _
(ByVal x1 As Long, ByVal y1 As Long, _
ByVal x2 As Long, ByVal y2 As Long) As Long
Private Declare Function combinergn Lib "gdi32" _
(ByVal hedstrgn As Long, ByVal hsrcrgn1 As Long, _
ByVal hsrcrgn2 As Long, ByVal ncombinemode As Long) As Long
Private Declare Function setwindowrgn Lib "user32" _
(ByVal hwnd As Long, ByVal hrgn As Long, _
ByVal bredraw As Boolean) As Long

Const rgn_xor = 3
Private Sub form_load()
Dim x1, x2
x1 = createellipticrgn(100, 100, 400, 400)
x2 = createellipticrgn(200, 100, 500, 400)
combinergn x1, x1, x2, rgn_xor
setwindowrgn hwnd, x1, 1
End Sub

efan2000 发表于 2003-10-28 11:46:00

不是,应该是VB的窗体还没创建,放到Click、Paint或者Resize等过程之中试试。

mccad 发表于 2003-10-28 11:49:00

声明的API函数与大小写有关,自己查查吧
http://vbworld.sxnw.gov.cn/vbapi/index.asp

gzy 发表于 2003-10-28 19:01:00

果然是分大小写的,多谢!
页: [1]
查看完整版本: [VBA]麻烦各位帮忙