ProgressBarRenderer.DrawVerticalChunks(Graphics, Rectangle) 메서드

정의

세로 진행률 표시줄을 채우는 일련의 진행률 표시줄 조각을 그립니다.

public:
 static void DrawVerticalChunks(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds);
public static void DrawVerticalChunks (System.Drawing.Graphics g, System.Drawing.Rectangle bounds);
static member DrawVerticalChunks : System.Drawing.Graphics * System.Drawing.Rectangle -> unit
Public Shared Sub DrawVerticalChunks (g As Graphics, bounds As Rectangle)

매개 변수

g
Graphics

진행률 표시줄을 그리는 데 사용되는 Graphics입니다.

bounds
Rectangle

진행률 표시줄 조각에 의해 채워지는 범위를 지정하는 Rectangle입니다.

예외

운영 체제에서 비주얼 스타일을 지원하지 않는 경우

또는

운영 체제에서 사용자가 비주얼 스타일을 사용하지 않도록 설정한 경우

또는

비주얼 스타일이 애플리케이션 창의 클라이언트 영역에 적용되지 않은 경우

예제

다음 코드 예제에서는 합니다 DrawVerticalChunks 의 메서드는 Timer.Tick 이벤트 처리기를 진행률 표시줄의 각 증분을 그립니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 ProgressBarRenderer 클래스입니다.

    // Handle the timer tick; draw each progressively larger rectangle.
private:
    void progressTimer_Tick(Object^ myObject, EventArgs^ e)
    {
        if (ticks < NumberChunks)
        {
            Graphics^ g = this->CreateGraphics();
            ProgressBarRenderer::DrawVerticalChunks(g,
                progressBarRectangles[ticks]);
            ticks++;
        }
        else
        {
            progressTimer->Enabled = false;
        }
    }
// Handle the timer tick; draw each progressively larger rectangle.
private void progressTimer_Tick(Object myObject, EventArgs e)
{
    if (ticks < NumberChunks)
    {
        using (Graphics g = this.CreateGraphics())
        {
            ProgressBarRenderer.DrawVerticalChunks(g,
                progressBarRectangles[ticks]);
            ticks++;
        }
    }
    else
    {
        progressTimer.Enabled = false;
    }
}
' Handle the timer tick; draw each progressively larger rectangle.
Private Sub progressTimer_Tick(ByVal myObject As [Object], ByVal e As EventArgs) 
    If ticks < NumberChunks Then
        Dim g As Graphics = Me.CreateGraphics()
        Try
            ProgressBarRenderer.DrawVerticalChunks(g, progressBarRectangles(ticks))
            ticks += 1
        Finally
            g.Dispose()
        End Try
    Else
        progressTimer.Enabled = False
    End If

End Sub

설명

이 메서드를 그린 각 진행률 표시줄 조각을의 너비로 확장 되는 bounds 매개 변수입니다. 진행률 표시줄 조각 그립니다 수가의 높이 따라 결정 됩니다 bounds 반환한 값과 ChunkSpaceThicknessChunkThickness합니다.

이 메서드를 사용 하기 전에 있는지 확인 해야 합니다 IsSupported 속성이 반환 true합니다.

적용 대상