ProgressBarRenderer.ChunkThickness プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)




ChunkThickness プロパティを使用して、DrawVerticalChunks メソッドによって描画されるプログレス バーの増分を表す各四角形のサイズを決定するコード例を次に示します。このコード例は、ProgressBarRenderer クラスのトピックで取り上げているコード例の一部分です。
' Initialize the rectangles used to paint the states of the ' progress bar. Private Sub SetupProgressBar() If Not ProgressBarRenderer.IsSupported Then Return End If ' Determine the size of the progress bar frame. Me.Size = New Size(ClientRectangle.Width, NumberChunks *(ProgressBarRenderer.ChunkThickness + 2 * ProgressBarRenderer.ChunkSpaceThickness) + 6) ' Initialize the rectangles to draw each step of the ' progress bar. progressBarRectangles = New Rectangle(NumberChunks) {} Dim i As Integer For i = 0 To NumberChunks ' Use the thickness defined by the current visual style ' to calculate the height of each rectangle. The size ' adjustments ensure that the chunks do not paint over ' the frame. Dim filledRectangleHeight As Integer = (i + 1) _ *(ProgressBarRenderer.ChunkThickness + 2 * ProgressBarRenderer.ChunkSpaceThickness) progressBarRectangles(i) = New Rectangle(ClientRectangle.X + 3, _ ClientRectangle.Y + ClientRectangle.Height - 3 - filledRectangleHeight, _ ClientRectangle.Width - 6, filledRectangleHeight) Next i End Sub 'SetupProgressBar
// Initialize the rectangles used to paint the states of the // progress bar. private void SetupProgressBar() { if (!ProgressBarRenderer.IsSupported) { return; } // Determine the size of the progress bar frame. this.Size = new Size(ClientRectangle.Width , (NumberChunks) * (ProgressBarRenderer.ChunkThickness + (2 * ProgressBarRenderer.ChunkSpaceThickness)) + 6); // Initialize the rectangles to draw each step of the // progress bar. progressBarRectangles = new Rectangle[NumberChunks]; for (int i = 0; i < NumberChunks; i++) { // Use the thickness defined by the current visual style // to calculate the height of each rectangle. The size // adjustments ensure that the chunks do not paint over // the frame. int filledRectangleHeight = ((i + 1) * (ProgressBarRenderer.ChunkThickness + (2 * ProgressBarRenderer.ChunkSpaceThickness))); progressBarRectangles[i] = new Rectangle( ClientRectangle.X + 3, ClientRectangle.Y + ClientRectangle.Height - 3 - filledRectangleHeight, ClientRectangle.Width - 6, filledRectangleHeight); } }
// Initialize the rectangles used to paint the states of the // progress bar. private: void SetupProgressBar() { if (!ProgressBarRenderer::IsSupported) { return; } // Determine the size of the progress bar frame. this->Size = System::Drawing::Size(ClientRectangle.Width , (NumberChunks * (ProgressBarRenderer::ChunkThickness + (2 * ProgressBarRenderer::ChunkSpaceThickness))) + 6); // Initialize the rectangles to draw each step of the // progress bar. progressBarRectangles = gcnew array<Rectangle>(NumberChunks); for (int i = 0; i < NumberChunks; i++) { // Use the thickness defined by the current visual style // to calculate the height of each rectangle. The size // adjustments ensure that the chunks do not paint over // the frame. int filledRectangleHeight = ((i + 1) * (ProgressBarRenderer::ChunkThickness + (2 * ProgressBarRenderer::ChunkSpaceThickness))); progressBarRectangles[i] = Rectangle( ClientRectangle.X + 3, ClientRectangle.Y + ClientRectangle.Height - 3 - filledRectangleHeight, ClientRectangle.Width - 6, filledRectangleHeight); } }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からProgressBarRenderer.ChunkThickness プロパティを検索する場合は、下記のリンクをクリックしてください。

- ProgressBarRenderer.ChunkThickness プロパティのページへのリンク