是否有必要在vb.net中创建类? [英] Is it necessary to create class in vb.net?

查看:95
本文介绍了是否有必要在vb.net中创建类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有必要在vb.net或任何其他专业级别的应用程序中创建类?

Is it necessary to create class in vb.net or any other application at professional level?

推荐答案

您可以直接单击按钮进行编码:处理程序将无论如何都可以添加到Form类中.
您不需要从按钮派生一个类来处理click事件.
You can code directly on the button click: the handler will be added to the Form class anyway.
You do not need to derive a class from a button to handle the click event.


这是.NET:所有方法都只在类和结构中,其他地方都没有.

传统的"非同类函数/过程的类似物是静态方法:它无权访问类实例(如果未在显式参数中显式传递).如果整个类的所有成员都是静态的,则它可以是静态的.

(专业"与否无关紧要:-.)

—SA
This is .NET: all methods are only in classes and structures, nowhere else.

The analog of "traditional" not-in-the-class function/procedure is a static method: it does not have access to a class instance (if not passed explicitly in an explicit parameter). The whole class can be static if all its members are static.

("Professional" or not, does not matter :-.)

—SA


这篇关于是否有必要在vb.net中创建类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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