15,795,209 members
Articles / Multimedia / GDI+

# Disc Used Space Control in Circle ProgressBar

Rate me:
4.89/5 (19 votes)
4 Mar 2009CPOL 53K   1.1K   33   13
This Circle ProgressBar tells you about DVD or CD used space

## Introduction

Hello!
I think Burning Applications should tell their users for disc (DVD/CD) used space in an attractive way, for example like this control.

## Background

With this control, you find used space of DVD in a Circle ProgressBar Control.
For example, Nero wants to tell users about DVD/CD used space. This is the best way, it isn't perfect, but nothing is perfect.

## Control Properties and Methods

Here is a list of the primary properties:

• `Disc Type`
With this property we change Type of Disc
example: from DVD(4500 MB) to CD(700 MB)
• `Valuemb `
Capacity of disc in MB

## Using the Code

Now let us see the code:

VB.NET
```'used variables
' l_1 is the main circle
' l_2 is the second circle
' l_3 is the third circle (smallest)
' l_4 is tells you for used space of disc
' d is diameter of l_1
' d2 is diameter of l_2
' d3 is diameter of l_3
' d4 is diameter of l_4
' d_temp is distance between l_1 and l_4
' p is the center of the form
' dim p as integer = me.width/2
' 'we use only p coordinate because width=height```
VB.NET
```Dim a as Double 'this value will be percentage of used space
'If type of Disc is DVD
a=(100 * Val(value_mb)) / 4500 ' valuemb is your value in mb
Dim d_temp As Integer
d_temp = d - (d / 4) 'distance between l_1 and l_4
d_per = ((a / 100) * d_temp) + d2 'diameter of l_4(used space circle)
r_per = d_per / 2 'radius of l_4(used space circle)
'Now we draw l_4 (used space circle)
e.Graphics.FillEllipse(color1, p - r_per, p - r_per, d_per, d_per)

'If type of Disc is CD
a=(100 * Val(value_mb)) / 700 ' valuemb is your value in mb
Dim d_temp As Integer
d_temp = d - (d / 4) 'distance between l_1 and l_4
d_per = ((a / 100) * d_temp) + d2 'diameter of l_4(used space circle)
r_per = d_per / 2 'radius of l_4(used space circle)
'Now we draw l_4 (used space circle)
e.Graphics.FillEllipse(color1, p - r_per, p - r_per, d_per, d_per) ```

On resize width of control must be equal to height:

VB.NET
```Me.Width = Me.Height
Me.Height = Me.Width```

## History

• Version 1.0 - 28 February 2009

## License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
Software Developer Appsix Mobile
Albania
Esat Pllana
Live in Mitrovica
Republic of Kosovo

## Comments and Discussions

 First Prev Next
 inspirational Southmountain13-May-23 14:14 Southmountain 13-May-23 14:14
 Re: inspirational Esat Pllana 202318-Sep-23 22:38 Esat Pllana 2023 18-Sep-23 22:38
 My vote of 5 Global Analyser5-Nov-10 1:31 Global Analyser 5-Nov-10 1:31
 only one issue mtkupp21-Apr-09 4:04 mtkupp 21-Apr-09 4:04
 Re: only one issue Esat Pllana21-Apr-09 6:47 Esat Pllana 21-Apr-09 6:47
 I can't understand you clearly! I think you said to get volume size automatically or what. Thank you
 Re: only one issue mtkupp21-Apr-09 7:06 mtkupp 21-Apr-09 7:06
 Re: only one issue Esat Pllana21-Apr-09 7:17 Esat Pllana 21-Apr-09 7:17
 Absolutely great fitimm13-Apr-09 5:37 fitimm 13-Apr-09 5:37
 5 xhevdacom9-Apr-09 7:22 xhevdacom 9-Apr-09 7:22
 Great first article Donsw21-Mar-09 18:43 Donsw 21-Mar-09 18:43
 WOW roberto.reff9-Mar-09 14:49 roberto.reff 9-Mar-09 14:49
 Good job! Shane Story5-Mar-09 4:47 Shane Story 5-Mar-09 4:47
 My vote of 5! Tarmo Kalda4-Mar-09 21:56 Tarmo Kalda 4-Mar-09 21:56
 Last Visit: 31-Dec-99 19:00     Last Update: 5-Dec-23 7:58 Refresh 1

General    News    Suggestion    Question    Bug    Answer    Joke    Praise    Rant    Admin

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.