Programing

Visual Studio의 숨겨진 기능 (2005-2010)?

crosscheck 2020. 5. 17. 15:41
반응형

Visual Studio의 숨겨진 기능 (2005-2010)?


Visual Studio는 매우 큰 제품으로 수년간의 작업을 거친 후에도 때로는 알지 못했던 일이나 일을 할 수있는 새로운 방법을 발견했습니다.

예를 들어

  • Crtl+ R, Ctrl+ W는 공백을 표시합니다. Python 빌드 스크립트를 편집하는 데 필수적입니다.

  • 에서 "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\Text Editor"생성 문자열라는 가이드 텍스트 편집기에서 열 (80)에서 레드 라인을 가지고 값 "RGB (255,0,0), 80"과 함께합니다.

다른 숨겨진 기능은 무엇입니까?


Alt 키를 누른 채로 선택-전체 줄 대신 텍스트의 제곱을 선택합니다.


추적 점!

코드 줄에 중단 점을 둡니다. 중단 점 창을 열고 새 중단 점을 마우스 오른쪽 단추로 클릭하십시오. '히트시 ...'를 선택하십시오. '메시지 인쇄'확인란을 선택하면 Visual Studio는 코드 줄이 실행될 때마다 (또는 끊어지지 않고) 디버그 출력에 메시지를 인쇄합니다. 줄을 통과 할 때 매크로를 실행하도록 할 수도 있습니다.


코드를 ToolBox로 드래그 할 수 있습니다. 시도 해봐!


식별자 (클래스 이름, 변수 등)를 클릭 한 다음 F12"정의로 이동" 을 누르십시오 . 코드를 느리게 마우스 오른쪽 버튼으로 클릭하여 "정의로 이동"방법을 사용하는 사람이 몇 명인지 항상 놀랐습니다.

편집 : 그런 다음 Ctrl+ -사용 하여 원래 위치로 돌아갈 수 있습니다 .


Ctrl + Shift + V는 클립 보드를 순환하며 Visual Studio는 복사 기록을 유지합니다.


사라 포드 (Sara Ford)는 많은 멋진 팁을 다룹니다 : http://blogs.msdn.com/saraford/archive/tags/Visual+Studio+2008+Tip+of+the+Day/default.aspx

그러나 내가 좋아하는 것 중 일부는 Code Snippets, <Namespace> 를 추가 하거나 메소드 스텁을 생성하는 Ctrl+ 입니다. 그것 없이는 살 수 없습니다..using

Visual Studio 2008 C # 키 바인딩 포스터에서 훌륭한 목록을 확인하십시오. http://www.microsoft.com/downloadS/details.aspx?familyid=E5F902A8-5BB5-4CC6-907E-472809749973&displaylang=en


CTRL-K, CTRL-D

문서를 다시 포맷하십시오!
이것은 VB 키 바인딩에 있으며 C #에 대해서는 확실하지 않습니다.


퀵 워치 또는 조사 식 창에서 배열을 몇 번 디버깅하고 Visual Studio에서 첫 번째 요소 만 표시합니까? 정의의 끝에 ", N"을 추가하면 studio에서 다음 N 개의 항목을 표시 할 수 있습니다. IE "this-> m_myArray"는 "this-> m_array, 5"가됩니다.


증분 검색 : 소스 문서 열기 (CTRL + I)를 누른 상태에서 검색중인 단어를 입력하면 (CTRL + I)을 다시 눌러 입력 내용과 일치하는 단어를 볼 수 있습니다.


조사 식 창에서 다음 코드를 사용할 수 있습니다.

@err - display last error
@err,hr - display last error as an HRESULT
@exception - display current exception

  • Ctrl-K, Ctrl-C시작 부분에 //텍스트 블록을 주석 처리
  • 시작시 //텍스트 블록의 주석을 해제 하려면 Ctrl-K, Ctrl-U

그것 없이는 살 수 없다! :)


디버거가 사소한 기능을 수행하는 것을 중지합니다.

디버거에서 코드를 단계별로 실행할 때 특히 관심이없는 함수를 가져오고 나가는 데 많은 시간을 GetID () 또는 std :: vector <> () C ++ 예제를 선택하십시오. 레지스트리를 사용하여 디버거가이를 무시하도록 할 수 있습니다.

Visual Studio 2005의 경우 HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ VisualStudio \ 8.0 \ NativeDE \ StepOver로 이동하여 제외하려는 각 함수 또는 함수 세트에 대한 정규식이 포함 된 문자열 값을 추가해야합니다. 예 :

std :: vector. * ::. *
TextBox :: GetID

개별 예외에 대해이를 무시할 수도 있습니다. 예를 들어, 벡터 클래스의 소멸자로 들어가기를 원한다고 가정하십시오.

std :: vector. * :: \ ~. * = StepInto

다른 버전의 Visual Studio에 대한 자세한 내용은 http://blogs.msdn.com/andypennell/archive/2004/02/06/69004.aspx 에서 확인할 수 있습니다.


Ctrl-F10 : 디버깅 중에 커서를 실행합니다. 나는 이것을 찾기 위해 나이를 먹었고, 나는 그것을 항상 사용한다.

Ctrl-E, Ctrl-D : 표준 형식을 적용합니다 (정의 할 수 있음).


Tab 키 기능 .

  1. 스 니펫 키 이름을 알고 있으면 더블 탭을 작성하고 클릭하십시오. 예를 들어 : 쓰기

    foreach

탭 키를 두 번 클릭하여

foreach (object var in collection_to_loop)
{

}

2. 이벤트를 작성하는 경우 여기에 작성하십시오

        Button btn = new Button();
        btn.Click +=         

탭 키를 두 번 클릭하여

private void Form1_Load(object sender, EventArgs e)
{
        Button btn = new Button();
        btn.Click += new EventHandler(btn_Click);     
}    
void btn_Click(object sender, EventArgs e)
{
        throw new Exception("The method or operation is not implemented.");
}

btn_Click 함수 자동 쓰기

  1. XAML 편집기에서 모든 이벤트를 작성하십시오. 예를 들면 다음과 같습니다.

MouseLeftButtonDown그런 다음 탭
MouseLeftButtonDown=""을 클릭 한 다음 생성 된 MouseLeftButtonDown="Button_MouseLeftButtonDown"코드 섹션 Button_MouseLeftButtonDown메소드 에서 탭을 다시 클릭하십시오 .


사라 포드 (Sara Ford)는이 시장이 우위에있다

http://blogs.msdn.com/saraford/default.aspx

More Visual Studio tips and tricks than you can shake a stick at.

Some others:

  • The Visual Studio 2005 and 2008 3-month trial editions are fully-functional, and can be used indefinitely (forever) by setting the system clock back prior to opening VS. Then, when VS is opened, set the system clock forward again so your datetimes aren't screwed up.
  • But that's really piracy and I can't recommend it, especially when anybody with a .edu address can get a fully-functional Pro version of VS2008 through Microsoft Dreamspark.
  • You can use Visual Studio to open 3rd-party executables, and browse embedded resources (dialogs, string tables, images, etc) stored within.
  • Debugging visualizers are not exactly a "hidden" feature but they are somewhat neglected, and super-useful, since in addition to using the provided visualizers you can roll your own for specific data sets.
  • Debugger's "Set Instruction Pointer" or "Set Next Statement" command.
  • Conditional breakpoints (as KiwiBastard noted).
  • You can use Quickwatch etc. to evaluate not only the value of a variable, but runtime expressions around that variable.

T4 (Text Template Transformation Toolkit). T4 is a code generator built right into Visual Studio


Custom IntelliSense dropdown height, for example displaying 50 items instead of the default which is IMO ridiculously small (8).

(To do that, just resize the dropdown next time you see it, and Visual Studio will remember the size you selected next time it opens a dropdown.)


Discovered today:

Ctrl + .

Brings up the context menu for refactoring (then one that's accessible via the underlined last letter of a class/method/property you've just renamed - mouse over for menu or "Ctrl" + ".")


A lot of people don't know or use the debugger to it's fullest - I.E. just use it to stop code, but right click on the red circle and there are a lot more options such as break on condition, run code on break.

Also you can change variable values at runtime using the debugger which is a great feature - saves rerunning code to fix a silly logic error etc.


Line transpose, Shift-Alt-T
Swaps two line (current and next) and moves cursor to the next line. I'm lovin it. I've even written a macro which changed again position by one line, executed line transpose and changed line position again so it all looking like I swapping current line with previous (Reverse line transpose).

Word transpose, Shift-Ctrl-T


When developing C++, Ctrl-F7 compiles the current file only.


Document Outline in the FormsDesigner (CTRL + ALT + T)

Fast control renaming, ordering and more!


To auto-sync current file with Solution Explorer. So don't have to look where the file lives in the project structure

Tools -> Options -> Projects and Solutions -> "Track Active Item in Solution Explorer"

Edit: If this gets too annoying for you then you can use Dan Vanderboom's macro to invoke this feature on demand through a keystroke.

(Note: Taken from the comment below by Jerry).


I'm not sure if it's "hidden", but not many people know about it -- pseudoregisters. Comes very handy when debugging, I've @ERR, hr in my watch window all the time.


Ctrl-Minus, Ctrl-Plus, navigates back and forward where you've been recently (only open files, though).


I don't use it often, but I do love:

ctrl-alt + mouse select

To select in a rectangular block, to 'block' boundaries.

As noted in comments,

alt + mouse select

Does just a plain rectangular block.


Here's something I learned (for C#):

You can move the cursor to the opening curly brace from the closing curly brace by pressing Control + ].

I learned this on an SO topic that's a dupe of this one:

“Hidden Secrets” of the Visual Studio .NET debugger?


CTRL + Shift + U -> Uppercase highlighted section. CTRL + U -> Lowercase the highlighted section Great for getting my SQL Statements looking just right when putting them into string queries.

Also useful for code you've found online where EVERYTHING IS IN CAPS.


Middle Mouse Button Click on the editor tab closes the tab.


To display any chunk of data as an n-byte "array", use the following syntax in Visual Studio's QuickWatch window:

variable, n

For example, to view a variable named foo as a 256-byte array, enter the following expression in the QuickWatch window:

foo, 256

This is particularly useful when viewing strings that aren't null-terminated or data that's only accessible via a pointer. You can use Visual Studio's Memory window to achieve a similar result, but using the QuickWatch window is often more convenient for a quick check.

참고URL : https://stackoverflow.com/questions/100420/hidden-features-of-visual-studio-2005-2010

반응형