设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 1322|回复: 2
打印 上一主题 下一主题

[其它] 请教类中实例的传递

[复制链接]
跳转到指定楼层
1#
发表于 2007-2-17 03:27:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
在用ctbutton做一个xp button的类,但是在实例化的时候遇到了麻烦,怎么也不能把窗体上的ctbutton对象引用到我的类的实例中去,高手帮忙呀。

类例程:

Private WithEvents mvarObjButton As ctButton


Public Property Let objButton(ByVal sInput As ctButton)
Set mvarObjButton = sInput
End Property



窗体上的程序

Sub LoadButton(currentItem As Integer)
Dim Ct As Control
Dim col As New Collection
'Dim ctButton As cXpButton
  For Each Ct In Me.navWindows.Pages(currentItem).Controls '只在当前页中循环
   If Ct.ControlType = 119 And Left(Ct.ControlName, 8) = "ctButton" Then
     Dim myCtButton As New cXpButton
     Dim tempButton As ctButton
     Set tempButton = Me.Controls(Ct.ControlName)
     myCtButton.objButton = tempButton
     col.Add myCtButton '将所有的ctbutton加入到col集合中去。
   End If
  Next  
End Sub

只是想在窗体装载的时候自动初始化成类里面定义的外观,现在就是不能把窗体上的ctbutton实例引入到我自己定义的cXpButton中使用。搞了好几天了。
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2007-2-17 20:07:00 | 只看该作者
最好把例子传上来
3#
 楼主| 发表于 2007-2-19 00:43:00 | 只看该作者
呵呵,已搞定,马虎的问题。谢谢版主了

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-5-2 06:36 , Processed in 0.087784 second(s), 26 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表