控件数组的响应事件无效!求救!

gongcom 2005-03-23 04:53:51
控件数组的响应事件无效,翻了很多帖子还是没有头绪,请帮忙!

class module
Option Explicit

Private WithEvents mShape As Shape
Public Property Set MsShape(ByVal vData As Shape)
Set mShape = vData
End Property
Public Property Get MsShape() As Shape

Set MsShape = mShape
End Property

Private Sub mShape_Click()
MsgBox mShape.Name
End Sub


调用:
Public Sub CreateShape(i As Integer)

Set a(i) = New Class1

Set a(i).MsShape = Controls.Add("VB.Shape", "oShape" & i, Form1)

a(i).MsShape.Visible = True
a(i).MsShape.Left = 5000
a(i).MsShape.Top = 5000
a(i).MsShape.Width = 1000
a(i).MsShape.Height = 1000

End Sub


控件显示出来了,但是捕捉不到任何事件!急!请帮忙!谢谢!
...全文
96 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
cumtbwxj 2005-08-25
  • 打赏
  • 举报
回复
http://community.csdn.net/Expert/topic/3938/3938646.xml?temp=.2606623
http://community.csdn.net/Expert/topic/3830/3830890.xml?temp=7.906741E-02
http://community.csdn.net/Expert/topic/3856/3856528.xml?temp=.3105585
http://community.csdn.net/Expert/topic/3875/3875079.xml?temp=.1331903
http://community.csdn.net/Expert/topic/3906/3906790.xml?temp=.9179346
http://community.csdn.net/Expert/topic/4078/4078914.xml?temp=.8830225
http://community.csdn.net/Expert/topic/4091/4091065.xml?temp=.5120508
http://community.csdn.net/Expert/topic/4163/4163245.xml?temp=1.737612E-02
http://community.csdn.net/Expert/topic/4138/4138263.xml?temp=.3854181
http://community.csdn.net/Expert/topic/4135/4135278.xml?temp=4.314601E-03
http://community.csdn.net/Expert/topic/4132/4132133.xml?temp=.8277399
http://community.csdn.net/Expert/topic/4102/4102825.xml?temp=.3572809
http://community.csdn.net/Expert/topic/4100/4100444.xml?temp=.3572809
http://community.csdn.net/Expert/TopicView.asp?id=3812799
http://community.csdn.net/Expert/topic/3722/3722976.xml?temp=.5472986
http://community.csdn.net/Expert/TopicView.asp?id=3717277
http://community.csdn.net/Expert/TopicView.asp?id=3710464
http://community.csdn.net/Expert/topic/3629/3629571.xml?temp=.7908899
http://community.csdn.net/Expert/topic/3536/3536511.xml?temp=.4289514
http://community.csdn.net/Expert/topic/3388/3388278.xml?temp=.2183802
http://community.csdn.net/Expert/TopicView.asp?id=3336113
http://community.csdn.net/Expert/topic/3265/3265830.xml?temp=.2758753

全部是讲动态控件的。
YaDa 2005-03-23
  • 打赏
  • 举报
回复
Shape控件没有事件啊。即使不是控件数组,单个的Shape 也没有事件。
lyllxfly 2005-03-23
  • 打赏
  • 举报
回复
同志,Shape没有事件!
如果是你作的,应加上事件,并且名称不要与现行系统的重复!

1,453

社区成员

发帖
与我相关
我的任务
社区描述
VB 控件
社区管理员
  • 控件
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧