TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Andrew
NA
1
0
Progress bars for drive size
Sep 5 2009 10:04 AM
I'm trying to make progressbars to display space used on the drives on the computer on the fly. My code is: [code] Private Sub DriveBox_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DriveBox.VisibleChanged Dim allDrives() As DriveInfo = DriveInfo.GetDrives() Dim d As DriveInfo Dim AvSpace As Integer Dim ToAvSpace As Integer Dim TotSpace As Integer Static num As Integer Dim NewProgressBar(num) As Control num += 1 For Each d In allDrives If d.IsReady = True Then If d.DriveType.ToString = "Fixed" Then lstdrives.Items.Add(d.Name) lstdrives.Items.Add(d.VolumeLabel) AvSpace = lstdrives.Items.Add(" Available space to current user: " & d.AvailableFreeSpace.ToString / 1024 / 1024 & " " & " MB") ToAvSpace = lstdrives.Items.Add(" Total available space: " & d.TotalFreeSpace.ToString / 1024 / 1024 & " " & " MB") TotSpace = lstdrives.Items.Add(" Total size of drive: " & d.TotalSize.ToString / 1024 / 1024 & " " & "MB") ReDim NewProgressBar(num) NewProgressBar(num - 1) = New ProgressBar() With NewProgressBar(num - 1) .Name = "Bar" & num .Location = New System.Drawing.Point(10, num * (.Height + 10)) End With Me.Controls.AddRange(New System.Windows.Forms.Control() {NewProgressBar(num - 1)}) Me.ProgressBar4.Value = (TotSpace - ToAvSpace) / 100 End If End If Next End Sub [/code]
Reply
Answers (
0
)
Pie graph with data in SQL
Creating a Scheduler (rota)