Sub New在哪里 [英] Where is Sub New

查看:88
本文介绍了Sub New在哪里的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个使用Partial Class的VS2005格式的项目。

我找不到存储子新代码的位置。


你能告诉我它在哪里吗?

谢谢

I have a couple of projects in the VS2005 format using Partial Class.
I can''t find where the code for sub New is stored.

Can you tell me where it is?
thanks

推荐答案

.Net提供了一个默认构造函数。如果你没有看到一个,那么

就是'正在使用的'。您可以将自己的内容添加到您的课程中,并且它将使用您的,而不是默认值。此外,如果你添加任何构造函数,

..Net假设你将创建你想要的所有构造函数,并且不会在幕后创建一个默认的构造函数。


Robin S.

----------------------------

"活性" < ac ********** @ a-znet.comwrote in message

news:uI ************* @ TK2MSFTNGP05.phx。 gbl ...
There is a default constructor provided by .Net. If you don''t see one, then
that''s what''s being used. You can just add your own to your class, and it
will use yours instead of the default. Also, if you add any constructors,
..Net assumes you will create all constructors that you want, and will not
create a default one behind the scenes.

Robin S.
----------------------------
" active" <ac**********@a-znet.comwrote in message
news:uI*************@TK2MSFTNGP05.phx.gbl...

>我有几个VS2005格式的项目使用Partial Class。

我找不到存储子新代码的地方。


你能告诉我它在哪里吗?


谢谢
>I have a couple of projects in the VS2005 format using Partial Class.
I can''t find where the code for sub New is stored.

Can you tell me where it is?
thanks



也许这解决了我前一段时间遇到的问题。


如果构造函数可以有参数。


我需要构造函数来获取参数,以便调用表单可以在初始化运行之前设置一些属性。


我可以我不太清楚Ide如何处理带参数的构造函数,但

我会玩它。


再次感谢


" RobinS" < Ro **** @ NoSpam.yah.nonewrote in message

news:xc ************************ ******@comcast.com。 ..
Maybe this solves a problem I had a while ago.

If the constructor can have arguments.

I needed the constructor to have arguments so that the calling form could
set some properties before Initialize was run.

I can''t quite see how the Ide can handle a constructor with arguments but
I''ll play with it.

Thanks again

"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:xc******************************@comcast.com. ..

.Net提供了一个默认构造函数。如果你没有看到一个,那么那就是'正在使用的'。您可以将自己的内容添加到您的班级,

,它将使用您的而不是默认值。此外,如果您添加任何

构造函数,。。Net假定您将创建所需的所有构造函数,

并且不会在幕后创建默认构造函数。


Robin S.

----------------------------

活性" < ac ********** @ a-znet.comwrote in message

news:uI ************* @ TK2MSFTNGP05.phx。 gbl ...
There is a default constructor provided by .Net. If you don''t see one,
then that''s what''s being used. You can just add your own to your class,
and it will use yours instead of the default. Also, if you add any
constructors, .Net assumes you will create all constructors that you want,
and will not create a default one behind the scenes.

Robin S.
----------------------------
" active" <ac**********@a-znet.comwrote in message
news:uI*************@TK2MSFTNGP05.phx.gbl...

>>我有几个VS2005格式的项目使用Partial Class。
我找不到存储子新的代码。

你能告诉我它在哪里吗?

谢谢
>>I have a couple of projects in the VS2005 format using Partial Class.
I can''t find where the code for sub New is stored.

Can you tell me where it is?
thanks




我不能完全看到Ide如何处理带参数的构造函数


它唯一引起任何麻烦的时间是if它是一个控件/组件

,它以设计器模式添加到表单/ usercontrol中。在这种情况下,

设计师不知道该怎么做,因为它不能指定参数。

你应该能够手动编辑设计器生成的代码是应对此问题的最简单方法。 (但要注意它可以/将覆盖

你想要的更改)。


谢谢,


Seth Rowe

3月1日上午10点16分,活性" < activeNOS ... @ a-znet.comwrote:
I can''t quite see how the Ide can handle a constructor with arguments

The only time it causes any troubles is if it is a control/component
that is added to a form/usercontrol in designer mode. In that case the
designer won''t know what to do since it can''t specify the parameters.
You should be able to manually edit the designer generated code is the
easiest way to cope with this. (but be warned it can/will overwrite
your changes when it wants to).

Thanks,

Seth Rowe
On Mar 1, 10:16 am, " active" <activeNOS...@a-znet.comwrote:

也许这解决了我前一段时间遇到的问题。


如果构造函数可以有参数。


我需要构造函数有参数,以便调用表单可以在运行Initialize之前设置一些属性。


我不能完全看到Ide如何处理带参数的构造函数,但

我会玩它。


再次感谢


" RobinS" < Rob ... @ NoSpam.yah.nonewrote in message


新闻:xc ********************* *********@comcast.com。 ..
Maybe this solves a problem I had a while ago.

If the constructor can have arguments.

I needed the constructor to have arguments so that the calling form could
set some properties before Initialize was run.

I can''t quite see how the Ide can handle a constructor with arguments but
I''ll play with it.

Thanks again

"RobinS" <Rob...@NoSpam.yah.nonewrote in message

news:xc******************************@comcast.com. ..

.Net提供了一个默认构造函数。如果你没有看到一个,那么那就是'正在使用的'。您可以将自己的内容添加到您的班级,

,它将使用您的而不是默认值。此外,如果您添加任何

构造函数,。。Net假定您将创建所需的所有构造函数,

并且不会在幕后创建默认构造函数。
There is a default constructor provided by .Net. If you don''t see one,
then that''s what''s being used. You can just add your own to your class,
and it will use yours instead of the default. Also, if you add any
constructors, .Net assumes you will create all constructors that you want,
and will not create a default one behind the scenes.


Robin S.

------------------- ---------

"活性" < activeNOS ... @ a-znet.com写了留言

新闻:uI ************* @ TK2MSFTNGP05.phx.gbl ...
Robin S.
----------------------------
" active" <activeNOS...@a-znet.comwrote in message
news:uI*************@TK2MSFTNGP05.phx.gbl...

>我有几个VS2005格式的项目使用Partial Class。

我找不到sub New的代码在哪里存储。
>I have a couple of projects in the VS2005 format using Partial Class.
I can''t find where the code for sub New is stored.


你能告诉我它在哪里吗?
Can you tell me where it is?


谢谢
thanks



这篇关于Sub New在哪里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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