问:主要在VB.net [英] Q: Main in VB.net
问题描述
嗨
VB.Net表单中与Main最接近的是什么?
Geoff
Hi
What is the closest equivalent to Main in a VB.Net form?
Geoff
推荐答案
" Geoff Jones" <无******** @ email.com> schrieb:
"Geoff Jones" <no********@email.com> schrieb:
VB.Net表单中与Main最接近的是什么?
What is the closest equivalent to Main in a VB.Net form?
在表单类''代码中:
\\\
Public Shared Sub Main()
...
结束Sub $ / $
///
在项目属性中,选择''Sub Main''作为启动对象。
-
MS Herfried K. Wagner
MVP< URL:http://dotnet.mvps.org/>
VB< URL:http://dotnet.mvps.org/dotnet/faqs/>
Inside your form class'' code:
\\\
Public Shared Sub Main()
...
End Sub
///
In the project properties, select ''Sub Main'' as the startup object.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Herfried,
在项目中属性,选择''Sub Main''作为启动对象。
或者只需选择Form的类作为启动对象。 VB.NET将看到
Form类有一个Shared Sub Main&使用它,而不是隐含地添加
一个。
表单示例我通常有一个MainForm类。
公共类MainForm
继承System.Windows.Forms.Form
...设计器生成的代码&其他代码
Public Shared Sub Main()
...
End Sub
结束班级
然后在我的项目属性中,我选择了MainForm作为启动
对象。
我不确定何时我会选择Sub Main。作为创业公司
对象...
希望这有帮助
Jay
" Herfried K. Wagner [MVP]" <喜*************** @ gmx.at>在消息中写道
news:eU ************** @ TK2MSFTNGP12.phx.gbl ..." Geoff Jones" <无******** @ email.com> schrieb:
In the project properties, select ''Sub Main'' as the startup object. Or simply select the Form''s class as the startup object. VB.NET will see the
Form class has a Shared Sub Main & use it, rather then implicitly adding
one.
Form example I normally have a MainForm class.
Public Class MainForm
Inherits System.Windows.Forms.Form
... designer generated code & other code
Public Shared Sub Main()
...
End Sub
End Class
Then in my Project Properties I have MainForm selected as the startup
object.
I''m not sure when I would ever actually select "Sub Main" as the startup
object...
Hope this helps
Jay
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eU**************@TK2MSFTNGP12.phx.gbl... "Geoff Jones" <no********@email.com> schrieb:
VB.Net表单中与Main最接近的是什么?
What is the closest equivalent to Main in a VB.Net form?
在表单类中的代码:
\\\
Public Shared Sub Main()
...
End Sub
///
在项目属性中,选择''Sub Main''作为启动对象。
- MS Herfried K. Wagner
MVP< URL:http://dotnet.mvps.org />
VB< URL:http://dotnet.mvps.org/dotnet/faqs/>
Inside your form class'' code:
\\\
Public Shared Sub Main()
...
End Sub
///
In the project properties, select ''Sub Main'' as the startup object.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Jay,
我认为没有真正的优势
Jay,
I see no real advantage in this
VB.NET会看到Form类有一个共享子主&使用它,而不是
然后隐含地添加一个。
VB.NET will see the Form class has a Shared Sub Main & use it, rather
then implicitly adding one.
我很高兴至少再次离开这样一个起点在
程序应该被称为main。
所以我很高兴它被隐式添加。
并不重要只是为了表达我对此的看法。
Cor
I am glad that at least is again leaved that way that the start point in a
program should be called "main".
So I am glad that it is implicitly added.
Not that important just to tell my thoughts about that.
Cor
这篇关于问:主要在VB.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!