我可以在 VS 2008 的 Windows 窗体设计器中将默认修饰符从 Friend 更改为 Private 吗? [英] Can I change the default modifier from Friend to Private in the Windows Forms designer in VS 2008?

查看:18
本文介绍了我可以在 VS 2008 的 Windows 窗体设计器中将默认修饰符从 Friend 更改为 Private 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用 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屋!

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