属性

vividlm 2003-08-20 01:52:33
自己设置的属性是否可同时传递多个参数。
如:Property Let MyInfo(ByRef vNewValue As Variant)
我想同时传递多个参数,用变量或数组传值可以吗?请各位高手帮忙解决。
...全文
34 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
道素 2003-08-20
  • 打赏
  • 举报
回复
Option Explicit

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Combo1,Combo1,-1,List
Public Property Get List(ByVal Index As Integer) As String
List = Combo1.List(Index)
End Property

Public Property Let List(ByVal Index As Integer, ByVal New_List As String)
Combo1.List(Index) = New_List
PropertyChanged "List"
End Property

'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Dim Index As Integer

'TO DO: The member you have mapped to contains an array of data.
' You must supply the code to persist the array. A prototype
' line is shown next:
Combo1.List(Index) = PropBag.ReadProperty("List" & Index, "")
End Sub

'Write property values to storage
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Dim Index As Integer

'TO DO: The member you have mapped to contains an array of data.
' You must supply the code to persist the array. A prototype
' line is shown next:
Call PropBag.WriteProperty("List" & Index, Combo1.List(Index), "")
End Sub
道素 2003-08-20
  • 打赏
  • 举报
回复
可以,你用vb的向导建立一个list属性让它指定到一个combo或list的list属性,你可以看到是怎么定义的

7,759

社区成员

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

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