我可以在 VS 2008 的 Windows 窗体设计器中将默认修饰符从 Friend 更改为 Private 吗? [英] Can I change the default modifier from Friend to Private in the Windows Forms designer in VS 2008?
问题描述
当我使用 C# 在 Visual Studio 中开发 Windows 窗体应用程序时,我添加到窗体中的每个控件默认都标记为 private
,这正是我想要的.
When I develop a Windows Forms app in Visual Studio using C#, every control that I add to my form is by default marked as private
, which is what I want.
使用 VB.NET 时,每个控件默认标记为 Friend
(相当于 internal
在 C# 中),这不是我想要的.
When using VB.NET, every control is by default marked as Friend
(the equivalent of internal
in C#), which is not what I want.
我可以更改此默认设置吗?看起来肯定是某个地方的设置.
Can I just change this default? It seems like surely it's a setting somewhere.
推荐答案
烦人,是不是.
我通常做的是当表单稳定时,我将Friend WithEvents
替换为Private
,然后将WithEvents
添加到具有<代码>句柄子句.
What I usually do is when the form is stable, I replace Friend WithEvents
to Private
then add WithEvents
to the controls that have Handles
clauses.
是的,你会认为有一个设置,但我从来没有找到.
Yes, you would think there was a setting, but I never found it.
这篇关于我可以在 VS 2008 的 Windows 窗体设计器中将默认修饰符从 Friend 更改为 Private 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!