Click here to Skip to main content
Licence CPOL
First Posted 4 Mar 2009
Views 25,688
Downloads 392
Bookmarked 30 times

Disc Used Space Control in Circle ProgressBar

By | 4 Mar 2009 | Article
This Circle ProgressBar tells you about DVD or CD used space
Prize winner in Competition "Best VB.NET article of March 2009"
cd-dvd_demo

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:

cd-dvd_demo

'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
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:

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)

About the Author

Esat Pllana

Software Developer

Albania Albania

Member

Esat Pllana
Live in Mitrovica
Republic of Kosovo

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 5 PinmemberHeaven20200:31 5 Nov '10  
Generalonly one issue Pinmembermtkupp3:04 21 Apr '09  
GeneralRe: only one issue PinmemberEsat Pllana5:47 21 Apr '09  
GeneralRe: only one issue Pinmembermtkupp6:06 21 Apr '09  
GeneralRe: only one issue PinmemberEsat Pllana6:17 21 Apr '09  
GeneralAbsolutely great Pinmemberfitimm4:37 13 Apr '09  
General5 Pinmemberxhevdacom6:22 9 Apr '09  
GeneralGreat first article PinmemberDonsw17:43 21 Mar '09  
GeneralWOW Pinmemberroberto.reff13:49 9 Mar '09  
GeneralGood job! PinmemberShane Story3:47 5 Mar '09  
GeneralMy vote of 5! PinmemberTarmo Kalda20:56 4 Mar '09  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

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

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120517.1 | Last Updated 4 Mar 2009
Article Copyright 2009 by Esat Pllana
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid