制作一个Enum gloabl [英] Making an Enum gloabl

查看:63
本文介绍了制作一个Enum gloabl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VB6中,我在类中声明为PUBLIC的枚举在本类之外是已知的。在otehr的话中,枚举是全局的,可以在声明它的类之外引用。


在VB.Net中,一个公共枚举是该类的本地声明或从Enum声明所在的类继承的类或类的实例。

解决方案

" Chad" < CH ************** @ unisys.com> schrieb

在VB6中,我在类中声明为PUBLIC的枚举在本类之外是已知的。在otehr的话中,枚举是全局的,可以在声明它的类之外引用。

在VB.Net中,公共枚举是该类的本地
声明或继承自Enum声明所在的
类的类或类的实例。




使用

Classname.Enumname



导入课程



在课堂外声明枚举。

-

Armin


如何报价以及原因:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


" Chad" < CH ************** @ unisys.com> schrieb

在VB6中,我在类中声明为PUBLIC的枚举在本类之外是已知的。在otehr的话中,枚举是全局的,可以在声明它的类之外引用。

在VB.Net中,公共枚举是该类的本地
声明或继承自Enum声明所在的
类的类或类的实例。




使用

Classname.Enumname



导入课程



在课堂外声明枚举。

-

Armin


如何报价以及原因:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


这也将使你的枚举全球化


公共模块modDeclarations

Public Enum MyEnum

enumval01

enumval02

结束枚举

结束模块


" Chad" < CH ************** @ unisys.com>在消息中写道

news:c5 ********** @ trsvr.tr.unisys.com ...

在VB6中,我声明的枚举在PUBLIC这个班级中,我们知道这个班级在
之外。在otehr的话中,枚举是全局的,可以在声明它的类的外部引用




在VB.Net中,公共枚举是声明它的类的本地或

继承自

枚举声明所在的类的类或类的实例。

In VB6, Enums that I declare within a class as PUBLIC are know outside of this class. In otehr words, the enum is global and may be referenced outside of the class in which it is declared.

In VB.Net, a Public enum is local to the class in which it is declared or instances of the class or classes that inherit from the class in which the Enum declaration resides.

解决方案

"Chad" <ch**************@unisys.com> schrieb

In VB6, Enums that I declare within a class as PUBLIC are know
outside of this class. In otehr words, the enum is global and may be
referenced outside of the class in which it is declared.

In VB.Net, a Public enum is local to the class in which it is
declared or instances of the class or classes that inherit from the
class in which the Enum declaration resides.



Use
Classname.Enumname
or
import the class
or
declare the Enum outside a class.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


"Chad" <ch**************@unisys.com> schrieb

In VB6, Enums that I declare within a class as PUBLIC are know
outside of this class. In otehr words, the enum is global and may be
referenced outside of the class in which it is declared.

In VB.Net, a Public enum is local to the class in which it is
declared or instances of the class or classes that inherit from the
class in which the Enum declaration resides.



Use
Classname.Enumname
or
import the class
or
declare the Enum outside a class.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


This will also make your enum global

Public Module modDeclarations
Public Enum MyEnum
enumval01
enumval02
End Enum
End Module

"Chad" <ch**************@unisys.com> wrote in message
news:c5**********@trsvr.tr.unisys.com...
In VB6, Enums that I declare within a class as PUBLIC are know outside of
this class. In otehr words, the enum is global and may be referenced outside
of the class in which it is declared.

In VB.Net, a Public enum is local to the class in which it is declared or
instances of the class or classes that inherit from the class in which the
Enum declaration resides.


这篇关于制作一个Enum gloabl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆