視覚的な基本的な円形のプログレスバー



Visual Basic Circular Progress Bar



解決:

GDI +を使って自分で描いてみてはいかがでしょうか。

後でこれを独自のユーザーコントロールに変換できますが、これで開始できます。それはかなり自明であるはずです:



Private Sub Form2_Paint(sender As Object、e As PaintEventArgs)Handles Me.Paint DrawProgress(e.Graphics、New Rectangle(5、5、60、60)、40)DrawProgress(e.Graphics、New Rectangle(80、5、60 、60)、80)DrawProgress(e.Graphics、New Rectangle(155、5、60、60)、57)End Sub Private Sub DrawProgress(g As Graphics、rect As Rectangle、percentage As Single) '各アークDimprogressAngle = CSng(360/100 *パーセンテージ)DimremainderAngle = 360-progressAngle 'アークに使用するペンを作成progressPenAs New Pen(Color.LightSeaGreen、2)、remainderPen As New Pen(Color.LightGray、2 ) 'より良い出力のためにスムージングを高品質に設定しますg.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias'青と白の円弧を描画しますg.DrawArc(progressPen、rect、-90、progressAngle)g.DrawArc(remainderPen、rect、progressAngle- 90、remainderAngle)End Using 'テキストの大きさを計算し、それに応じて座標を調整することにより、中央にテキストを描画します。fntAsNew Font(Me.Font.FontFami ly、14)Dim text As String = percent.ToString + '%' Dim textSize = g.MeasureString(text、fnt)Dim textPoint As New Point(CInt(rect.Left +(rect.Width / 2)-(textSize。 Width / 2))、CInt(rect.Top +(rect.Height / 2)-(textSize.Height / 2))) 'これで、すべての値でテキストを描画できますg.DrawString(text、fnt、Brushes.Black 、textPoint)End Using EndSubを使用して終了

出力

ここに画像の説明を入力してください