방법: 상태 표시줄 진행 표시줄 영역을 프로그래밍 합니다.
진행률 표시줄 영역에 있는 Visual Studio 증분 디스크에 파일을 저장할 빠른 작업 진행 상황, 예를 들어, 상태 표시줄에 표시 됩니다.
Visual Studio 상태 표시줄의 진행률 표시줄 영역을 사용.
인스턴스를 가져오기는 IVsStatusbar 인터페이스를 통해 사용할 수 있게 되는 SVsStatusbar 서비스 합니다.
초기화를 호출 하 여 시작 하는 값에는 진행률 표시줄의 Progress 메서드.
작업을 사용 하 여 진행 되는 동안 진행률 표시줄을 업데이트는 Progress 새 값을 설정 하는 방법입니다.
예제
이 예제에서는 초기화 하 고 진행률 표시줄을 업데이트 하는 방법을 보여 줍니다.
Private Sub ProgressBarExample()
Dim statusBar As IVsStatusbar = DirectCast(GetService(GetType(SVsStatusbar)), IVsStatusbar)
Dim cookie As UInteger = 0
Dim label As String = "Progress bar label..."
' Initialize the progress bar.
statusBar.Progress(cookie, 1, "", 0, 0)
Dim i As UInteger = 0, total As UInteger = 100
While i <= total
' Display incremental progress.
statusBar.Progress(cookie, 1, label, i, total)
System.Threading.Thread.Sleep(1)
i += 1
End While
' Clear the progress bar.
statusBar.Progress(cookie, 0, "", 0, 0)
End Sub
void ProgressBarExample()
{
IVsStatusbar statusBar =
(IVsStatusbar)GetService(typeof(SVsStatusbar));
uint cookie = 0;
string label = "Progress bar label...";
// Initialize the progress bar.
statusBar.Progress(ref cookie, 1, "", 0, 0);
for (uint i = 0, total = 100; i <= total; i++)
{
// Display incremental progress.
statusBar.Progress(ref cookie, 1, label, i, total);
System.Threading.Thread.Sleep(1);
}
// Clear the progress bar.
statusBar.Progress(ref cookie, 0, "", 0, 0);
}
예의 코드:
인스턴스를 가져옵니다는 IVsStatusbar 의 인터페이스는 SVsStatusbar 서비스.
진행률 표시줄을 호출 하 여 시작 값을 지정 된 초기화는 Progress 메서드가 있습니다.
작업을 반복 하 여 시뮬레이션을 for 반복 하 고 진행률 표시줄 값을 사용 하 여 업데이트를 Progress 메서드.
진행률 표시줄을 사용 하 여 취소는 Clear 메서드.
참고 항목
작업
방법: 상태 표시줄의 디자이너 영역을 프로그래밍 합니다.