自定义类,类中有枚举属性,如何通过IntelliSense弹出一个包含可接受值的列表框?

realjoshzuo 2008-06-28 10:26:00
自定义类MyTest,类中部分代码:

Private ipriorityType As PriorityType
Public Property Priority() As Integer
Get
Return ipriorityType
End Get
Set(ByVal value As Integer)
ipriorityType = value
End Set
End Property

Public Enum PriorityType
High = 2
Low = 1
Normal = 3
xxxx = 0
End Enum


应用程序引用这个类后,如何通过IntelliSense弹出一个包含可接受值的列表框?

我输入
Dim iMyTest As New MyTest
然后
iMyTest.TestType=
但是当输入"="后,并没有弹出一个包含可接受值的列表框!



...全文
71 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
amandag 2008-06-28
  • 打赏
  • 举报
回复
Imports System

Class MyTest
Private ipriorityType As PriorityType
Public Property Priority() As PriorityType
Get
Return ipriorityType
End Get
Set(ByVal value As PriorityType)
ipriorityType = value
End Set
End Property

Public Enum PriorityType
High = 2
Low = 1
Normal = 3
xxxx = 0
End Enum
Shared Sub Main()
Dim iMyTest As New MyTest
iMyTest.Priority = PriorityType.High
Console.Write(iMyTest.Priority)
End Sub
End Class
vlsm 2008-06-28
  • 打赏
  • 举报
回复
修改为:

Private ipriorityType As PriorityType
Public Property Priority() As PriorityType
Get
Return ipriorityType
End Get
Set(ByVal value As PriorityType)
ipriorityType = value
End Set
End Property

16,556

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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