http://www.21code.com/codebase/?pos=list&type=search&key=类
解决方案 »
- ShellExecute 0,"open","c:\\test.txt",0,0,3提示“子过程或函数未定义?
- vb+access,求一条sql语句
- Picturebox的打印问题。帮忙看看
- 讓VSFlexGrid的一行變成紅色,語句怎麽寫呀?怎樣限定輸入文本框的字符個數?
- 如何用VB处理图像实现物体体积的测量?
- 关于VB6中用Adodc控件确定记录位置的问题
- 请问哪种类型(dll,ocx,tlb,)的控件文件包含“类”的定义
- 急问,关于跨form传递winsock参数
- 请问怎样让表格每增加一行,自动再表格中添加一个checkbox控件!?谢谢!
- 绝对给分-★★请问如何将.chm文件转换为.htm或其它格式文件★★
- 急寻:VBA代码保护
- vb中用sql统计查询遇到的问题
Private mvarListCount As Long 'local copy
Private mvarListIndex As Long 'local copy
Private mvarSorted As Boolean 'local copy
Private mvarSelText As String 'local copy
Private mvarTopIndex As Long 'local copyPrivate mvarList() As String
Private mvarItemData() As String
Private mvarItemSelected() As Boolean
Private mvarErr As String 'local copy
Public Property Let Err(ByVal vData As String)
mvarErr = vData
End Property
Public Property Get Err() As String
Err = mvarErr
End PropertyPrivate Sub Class_Initialize()
ReDim Preserve mvarList(0)
ReDim Preserve mvarItemData(0)
ReDim Preserve mvarItemSelected(0)
mvarListCount = -1
End SubPublic Sub RemoveItem(ByVal Index As Long)
If vData <= UBound(mvarList) And vData >= LBound(mvarList) Then
Dim NmvarList() As String
Dim NmvarItemData() As String
Dim NmvarItemSelected() As String
ReDim Preserve NmvarList(mvarListCount - 2)
ReDim Preserve NmvarItemData(mvarListCount - 2)
ReDim Preserve NmvarItemSelected(mvarListCount - 2)
Dim i As Integer
For i = 0 To Index - 1
NmvarList(i) = mvarList(i)
NmvarItemData(i) = mvarItemData(i)
NmvarItemSelected(i) = mvarItemSelected(i)
Next i
If Index < mvarListCount - 1 Then
For i = Index + 1 To mvarListCount - 1
NmvarList(i - 1) = mvarList(i)
NmvarItemData(i - 1) = mvarItemData(i)
NmvarItemSelected(i - 1) = mvarItemSelected(i)
Next i
End If
Erase mvarList
Erase mvarItemData
Erase mvarItemSelected
mvarList = NmvarList
mvarItemData = mvarItemData
mvarItemSelected = mvarItemSelected
mvarListCount = mvarListCount - 1
Else
mvarErr = "Invalid Index!"
Exit Property
End If
End SubPublic Property Let TopIndex(ByVal vData As Long)
mvarTopIndex = vData
End Property
Public Property Get TopIndex() As Long
If vData <= UBound(mvarList) And vData >= LBound(mvarList) Then
TopIndex = mvarTopIndex
Else
mvarErr = "Invalid Index!"
Exit Property
End IfEnd PropertyPublic Property Let SelText(ByVal vData As String)
mvarSelText = vData
End Property
Public Property Get SelText() As String
SelText = mvarSelText
End PropertyPublic Property Let Sorted(ByVal vData As Boolean)
mvarSorted = vData
End Property
Public Property Get Sorted() As Boolean
Sorted = mvarSorted
End PropertyPublic Property Let ListIndex(ByVal vData As Long)
If vData <= UBound(mvarList) Then
mvarListIndex = vData
Else
mvarErr = "Invalid Index!"
Exit Property
End If
End Property
Public Property Get ListIndex() As Long
ListIndex = mvarListIndex
End Property
Public Property Get ListCount() As Long
ListCount = mvarListCount
End PropertyPublic Sub Clear() Erase mvarList
Erase mvarItemData
Erase mvarItemSelected
ReDim Preserve mvarList(0)
ReDim Preserve mvarItemData(0)
ReDim Preserve mvarItemSelected(0) mvarListCount = -1
End SubPublic Sub AddItem(ByVal Item As String, Optional ByVal Index As Long)
If Not IsMissing(Index) Then
If Index <> mvarListCount + 1 Then
mvarErr = "Invalid Index!"
Exit Function
End If
End If
If mvarListCount <> -1 Then
ReDim Preserve mvarList(mvarListCount + 1)
ReDim Preserve mvarItemData(mvarListCount + 1)
ReDim Preserve mvarItemSelected(mvarListCount + 1)
End If
mvarListCount = mvarListCount + 1
mvarNewIndex = mvarListCount
mvarList(mvarListCount) = Item
mvarItemData(mvarListCount) = 0
mvarItemSelected(mvarListCount) = False
End SubPublic Property Let List(ByVal Index As Long, ByVal vData As String)
AddItem vData, IndexEnd Property
Public Property Get List(ByVal Index As Long) As String If Index > UBound(mvarList) Then
mvarErr = "Invalid Index!"
Exit Property
End If
List = mvarList(Index)End Property
Public Property Get NewIndex() As Long
NewIndex = mvarNewIndex
End Property
Public Property Let ItemData(ByVal Index As Long, ByVal vData As String)
If Index <= UBound(mvarList) Then
mvarItemData(Index) = vData
Else
mvarErr = "Invalid Index!"
Exit Property
End If
End Property
Public Property Get ItemData(ByVal Index As Long) As String If Index <= UBound(mvarList) Then
ItemData = mvarItemData(Index)
Else
mvarErr = "Invalid Index!"
Exit Property
End If
End PropertyPublic Property Let ItemSelected(ByVal Index As Long, ByVal vData As Boolean)
If Index <= UBound(mvarList) Then
mvarItemSelected(Index) = vData
Else
mvarErr = "Invalid Index!"
Exit Property
End If
End Property
Public Property Get ItemSelected(ByVal Index As Long) As Boolean If Index <= UBound(mvarList) Then
ItemSelected = mvarItemSelected(Index)
Else
mvarErr = "Invalid Index!"
Exit Property
End If
End Property