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

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


控件显示出来了,但是捕捉不到任何事件!急!请帮忙!谢谢!
...全文
70 点赞 收藏 3
写回复
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没有事件!
如果是你作的,应加上事件,并且名称不要与现行系统的重复!
回复 点赞
发动态
发帖子
控件
创建于2007-09-28

1223

社区成员

4.1w+

社区内容

VB 控件
社区公告
暂无公告