阻止设计器弹出.cs文件? [英] Stop Designer from popping up on a .cs file?

查看:44
本文介绍了阻止设计器弹出.cs文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Form1.cs中有很多代码,所以我将其中的一些代码移到另一个文件中,

Form1Op.cs,它仍然是Form1:Form的部分类。


每当我打开Form1Op.cs时,它都希望在Form Designer中打开,而不是在

View Code中打开。我怎么能改变呢? (或者我可以吗?)


它编译得很好。

I had a lot of code in Form1.cs, so I moved some of it into another file,
Form1Op.cs, which is still a partial class of Form1 : Form.

Whenever I open Form1Op.cs, it wants to open in Form Designer rather than in
View Code. How can I change that? (Or can I?)

It compiles fine.

推荐答案

"迈克尔A. Covington < mc@uga.eduwrote in message

news:%2 **************** @ TK2MSFTNGP04.phx.gbl ...
"Michael A. Covington" <mc@uga.eduwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...

>我在Form1.cs中有很多代码,所以我将其中的一些代码移到另一个文件中,
Form1Op.cs,它仍然是一个部分类Form1:Form。


每当我打开Form1Op.cs时,它都想在Form Designer中打开,而不是在View Code中打开
。我怎么能改变呢? (或者我可以?)
>I had a lot of code in Form1.cs, so I moved some of it into another file,
Form1Op.cs, which is still a partial class of Form1 : Form.

Whenever I open Form1Op.cs, it wants to open in Form Designer rather than
in View Code. How can I change that? (Or can I?)



我对此表示怀疑。想一想。 Form1.cs中的代码很可能只是功能代码,而不是定义UI的东西(在

Form1.Designer.cs中),但是双击Form1会发生什么?

设计师打开。如果IDE只是在双击.Designer文件并打开

代码模式中的所有其他内容时,IDE会打开设计器

会有点好,但是我我相信很多人都会抱怨它,因为

喜欢它。

I doubt it. Think about it. The code in Form1.cs is more than likely just
functional code, not the stuff that defines the UI (that''s in
Form1.Designer.cs), but what happens when you double-click on Form1? The
designer opens. It would be kind of nice if the IDE would open the designer
only when you double-click the .Designer file and open everything else in
code mode, but I''m sure as many people would complain about that as would
enjoy it.


如果你在谈论双击文件的时候解决方案中的名称

资源管理器,只需右键单击并查看代码即可。


" Jeff Johnson" < i。*** @ enough.spamwrote in message

news:%2 ***************** @ TK2MSFTNGP06.phx.gbl .. 。
If you are talking about when you double click on the file name in Solution
Explorer, just right click and view code.

"Jeff Johnson" <i.***@enough.spamwrote in message
news:%2*****************@TK2MSFTNGP06.phx.gbl...

" Michael A. Covington" < mc@uga.eduwrote in message

news:%2 **************** @ TK2MSFTNGP04.phx.gbl ...
"Michael A. Covington" <mc@uga.eduwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...

>>我在Form1.cs中有很多代码,所以我将其中的一些代码移到另一个文件中,
Form1Op.cs,这仍然是一个部分Form1:Form。

每当我打开Form1Op.cs时,它都想在Form Designer中打开而不是在View Code中打开。我怎么能改变呢? (或者我可以?)
>>I had a lot of code in Form1.cs, so I moved some of it into another file,
Form1Op.cs, which is still a partial class of Form1 : Form.

Whenever I open Form1Op.cs, it wants to open in Form Designer rather than
in View Code. How can I change that? (Or can I?)



我对此表示怀疑。想一想。 Form1.cs中的代码很可能只是功能代码,而不是定义UI的东西(在

Form1.Designer.cs中),但是双击Form1会发生什么?

设计师打开。如果IDE只在双击.Designer文件并在代码模式下打开所有内容

else时打开

设计器会更好。但是我' 我相信很多人都会抱怨这个好像



I doubt it. Think about it. The code in Form1.cs is more than likely just
functional code, not the stuff that defines the UI (that''s in
Form1.Designer.cs), but what happens when you double-click on Form1? The
designer opens. It would be kind of nice if the IDE would open the
designer only when you double-click the .Designer file and open everything
else in code mode, but I''m sure as many people would complain about that
as would enjoy it.



" Mel Weaver" ; <我*********** @ Insdirect.com写了留言

新闻:OF **************** @ TK2MSFTNGP06。 phx.gbl ...
"Mel Weaver" <Me***********@Insdirect.comwrote in message
news:OF****************@TK2MSFTNGP06.phx.gbl...

如果您在谈论双击

解决方案资源管理器中的文件名时,请右键单击并查看代码。
If you are talking about when you double click on the file name in
Solution Explorer, just right click and view code.



是的,当然,但我认为海报上谈的是默认

行动,即当你发生什么时双击,而不是他在设计视图中打开它

然后从那里切换到代码视图。

Yes, of course, but I assumed the poster was talking about the "default"
action, i.e., what happens when you double-click, not that he HAD to open it
in Design view and then switch to Code view from there.


这篇关于阻止设计器弹出.cs文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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