Is FORM1 Is it a class name or an object name?

xiaoxiao2021-03-06  65

Suddenly I felt doubtful, according to reasoning is a class name, the code is written clearly, from forms.form, and allows inheritance and the instance of it. But it is biased to be used as an instance.

In the Han Rui's tutorial, it is found that it cannot be in the form of form2.show in the program, but must

DIM FRM AS New Form2

Frm.show

Or use in the launched module

DIM FRM AS New Form1

Application.Run (FRM)

Perhaps the problem is on the startup, actions at startup, so that the Form1 becomes an object by a class. It turns out that the object name and class name can be used:

Module Module1 Class C1 Public SHOW () System.Console.writeline ("Hello") End Sub End Class

Sub main () DIM C1 AS New C1 C1.SHOW () system.console.readline () End Sub

End module

转载请注明原文地址:https://www.9cbs.com/read-120022.html

New Post(0)