vb为什么总提示,编译错误:用户定义类型以及declare语句不允许作为对象模块的public成员
PublicDeclareFunctionFindWindowLib"user32"Alias"FindWindowA"(ByVallpClassNameAsString...
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub Form_Load()
Dim dd As Long
dd = FindWindow(vbNullString, "记事本")
If dd = 0 Then
Label1.Caption = "123"
Else
Label1.Caption = "456"
End If
End Sub
哪地方错了 展开
Private Sub Form_Load()
Dim dd As Long
dd = FindWindow(vbNullString, "记事本")
If dd = 0 Then
Label1.Caption = "123"
Else
Label1.Caption = "456"
End If
End Sub
哪地方错了 展开
2个回答
展开全部
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
把public改为private
把public改为private
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询