呵呵,不是我要這樣認為啊,,,,是我這邊的情況就是這樣的嘛.
我把代碼貼出來,幫我看看是代碼的問題還是其它原因?
'Module1:
Public Type udRowOrCol
udRow As Long
udCol As Long
End Type
'UserControl:
Public Function FindStr(ByVal strValue As String, Optional CompareType As VbCompareMethod = vbTextCompare) As udRowOrCol
Dim I As Integer
Dim J As Integer
For I = 0 To Combo1.ListCount - 1
For J = 0 To Combo1.ColumnCount - 1
If StrComp(Combo1.List(I, J), strValue, CompareType) Then
FindStr.udCol = I
FindStr.udRow = J
Exit Function
End If
Next
Next
End Function
'為什麼會出現以下錯誤呢????:
"Private Enum and user-defined types cannot be used as parameters or return types for public procedures, public data members, or fields of public user-defined types"
在控件工程2中加入代码
Type MyRecord
name As String
End Type
Function doit(ByVal par As Integer) As MyRecord
Dim aa As MyRecord
If par = 1 Then
aa.name = "yes"
Else
aa.name = "no"
End If
doit = aa
End Function
在控件工程2中加入代码
Type MyRecord
name As String
End Type
Function doit(ByVal par As Integer) As MyRecord
Dim aa As MyRecord
If par = 1 Then
aa.name = "yes"
Else
aa.name = "no"
End If
doit = aa
End Function