c# - 在带有 C# 的 Visual Studio 中,如何使 () 在我键入时自动出现,例如 .Focus()?

标签 c# .net visual-studio visual-studio-2010 windows-phone-7

在 Visual Studio 2010 Express 中键入以下内容时:

txtUsername.Fo

然后按回车键,它只会使用 Intellisense 创建以下内容:

txtUsername.Focus

我希望它执行以下操作:

txtUsername.Focus()

有没有办法让 Intellisense 为我自动添加 () 作为函数的结尾?

最佳答案

我认为 Visual Studio 没有这个选项。
有点相关 - 在某些情况下,TabTab 会自动插入一个片段。
例如,if + TabTab 给你:

if (|)
{

}
else
{

}

但是,我绝对喜欢Resharper并完全推荐它。
除了所有其他大括号({}[]<>)和十亿个其他功能之外,它还包括此功能。

关于c# - 在带有 C# 的 Visual Studio 中,如何使 () 在我键入时自动出现,例如 .Focus()?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8451341/

相关文章:

c# - token 已过期或撤销 - Google Ads

c# - 什么会生成WebServiceRef Reference.cs文件?

c# - 如何在 C# 中处理 XML

c# - Form1 资源与项目资源

c# - 当我尝试添加文件时 Visual Studio 卡住

c# - 为什么即使创建了显式运算符我也无法将源类型转换为字符串?

c# - sizeof 根据字段顺序给出不同的结果

.net - 在 Visual Studio 2010 Ultimate 中找不到负载测试

c - VS 2017 + cmake + 忍者 + mingw

c# - 是否可以访问接口(interface)类型的其他成员?