![](/img/trans.png)
[英]How to fill a DataGridView in Visual Studio 2017 automatically?
[英]How to automatically place cursor between braces on its own line using Visual Studio 2017
當我在 Visual Studio 2017 (C#) 中放置一個左大括號時,光標會自動轉到結束大括號左側的下一行。 像這樣(句點作為光標):
if() {
.}
我希望光標像這樣自動位於自己的行上(句點作為光標):
if() {
.
}
有誰知道如何使光標自動移動到第二個示例中句點所在的位置?
當您處於示例中的狀態 1 時,請使用Ctrl + Enter 。
這會將您所在的行向下發送一個級別,但將光標保持在當前位置。 實際上,這將使您從示例中的狀態 1 變為示例中的狀態 2。
不確定,因為我在 VS 2013 上,但你要找的可能在
工具 --> 選項 --> 文本編輯器 --> C# --> 格式化 --> 新行
如果您想自動將光標放在花括號內(即沒有任何快捷方式),您可以從Tools -> Options -> Text Editor -> C/C++ -> Formatting -> (check) Automatically format braces when they are automatically completed
。
當然,這是針對 C/C++ 的。 我不使用 C#,所以我沒有嘗試過 C#,但它應該是相似的,可能是Tools -> Options -> Text Editor -> C# -> Code Style -> Formatting -> (check) Automatically format block on }
(如果我錯了,請糾正我)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.