Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 244,308 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 829 people online right now. Registration is fast and FREE... Join Now!




ProgressBar

 
Reply to this topicStart new topic

ProgressBar

Jarrhed
3 Jan, 2009 - 04:05 PM
Post #1

D.I.C Head
**

Joined: 1 Jan, 2009
Posts: 61


My Contributions
As part of the program im making, Warez-One Install Manager I need to have a progress bar so the user doesn't think the program is frozen and I have no idea how to do it here is the code for the 2nd notification window in which the progress bar goes on

Dialog1.vb
CODE
Imports System.Windows.Forms

Public Class Package_Installation

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

    Private Sub Package_Installation_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated

    End Sub

    Private Sub Package_Installation_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.GotFocus
    

    End Sub

    Private Sub Package_Installation_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load




    End Sub

    Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub Finish_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Finish_Button.Click
        Warez_One_Package_Manager.First_Form.Close()
        Me.Close()
    End Sub

    Private Sub INSTALLBUTTON1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INSTALLBUTTON1.Click
        Me.InstallingSoftware.Show()
        Me.Installation_Label.Hide()

        Me.INSTALLBUTTON1.Hide()



        Dim item As Object

        System.Threading.Thread.Sleep(100)
        'Setting it to pause for 100 miliseconds so you can see the Package_Installation Window



        '------------------------------------------------Web Browsers---------------------------------------------------------------
        For Each item In First_Form.Browser_CheckListBox.CheckedItems
            Select Case item.ToString()

                Case "Mozilla Firefox"
                    ' Action if the item text is Mozilla Firefox.
                    My.Computer.Network.DownloadFile _
                    ("http://mozilla.ussg.indiana.edu/pub/mozilla.org/firefox/releases/3.0.5/win32/en-US/Firefox%20Setup%203.0.5.exe", _
                    "C:\Program Files\Warez-One Package Manager\Downloaded Packages\Firefox_3.05_Setup.exe")
                    'Where the file goes & above that the url of the file & above that the download command
                    Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Firefox.bat")

                Case "SeaMonkey"
                    My.Computer.Network.DownloadFile _
                   ("http://mirror.cc.vt.edu/pub/mozilla//seamonkey/releases/1.1.14/seamonkey-1.1.14.en-US.win32.installer.exe", _
                   "C:\Program Files\Warez-One Package Manager\Downloaded Packages\seamonkey-1.114.en-US.win32.installer.exe")
                    Shell("C:\Program Files\Warez-One Install Manage\Silent Installation Scripts\SeaMonkey.bat")
                    ' Action if the item text is SeaMonkey.
                Case "Opera"
                    My.Computer.Network.DownloadFile _
                    ("http://opera.releasenotes.org/win/963/en/Opera_963_en_Setup.exe", "C:\Program Files\Warez-One Package Manager\Downloaded Packages\OperaInstall.exe")
                    Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Opera.bat")
                    ' Action if the item text is Opera.
                Case "Safari"
                    My.Computer.Network.DownloadFile _
                    ("http://appldnld.apple.com.edgesuite.net/content.info.apple.com/Safari3/061-5806.20081124.bOHxyj/SafariSetup.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\SafariInstall.exe")
                    Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Safari.bat")
                    ' Action if the item is Safari
                Case "Flock"
                    My.Computer.Network.DownloadFile _
                    ("http://ftp.osuosl.org/pub/flock/releases/2.0.3/flock-2.0.3.en-US.win32.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\FlockInstaller.exe")
                    Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Flock.bat")
                    '------------------------------------------------Web Browsers---------------------------------------------------------------

            End Select
        Next
        '--------------------------------------------------------Multimedia------------------------------------------------------------------
        Dim itze As Object

        For Each itze In First_Form.Multimedia_CheckListBox.CheckedItems

        Next
        Select Case itze.ToString()
            Case "Pidgin Instant Messenger"
                My.Computer.Network.DownloadFile _
                    ("http://internap.dl.sourceforge.net/sourceforge/pidgin/pidgin-2.5.3.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\PidginInstall.exe")
                'Downloading Pidgin 2.5.3 into specified directory
                Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Pidgin.bat")
                'Running the silent install script to install pidgin and then remove it from the package manager's downloaded files directory
            Case "Miranda IM"
                My.Computer.Network.DownloadFile _
                    ("http://superb-east.dl.sourceforge.net/sourceforge/miranda/miranda-im-v0.7.13-unicode.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\MirandaIMInstall")
                Shell("C:\Program Files\Warez-One Install Manager\Silent Installalltion Scripts\MirandaIM.bat")
            Case "Internet Download Manager"
                My.Computer.Network.DownloadFile _
                ("http://www.internetdownloadmanager.com/idman515.exe", "C:\Program Files\Warez-One Package Install Manager\Downloaded Packages\IDManInstall.exe")
                Shell("C:\Program Files\Warez-One Package Install Manager\Silent Installation Scripts\IDMAN.bat")
            Case "Download Accelerator Plus"
                My.Computer.Network.DownloadFile _
                ("http://software-files.download.com/sd/ OEqIbdWD7xKk2ZgvdJrR7MXQ8QXqTvEAXquP_E7V9SRFJOEJnsTBhW2Kjtkpnie9bG3semAdiGt2kCRs
inNgflFlWOn-9sjl/software/10993668/10037157/3/dap9.exe?lop=link&ptype=1901&ontid=2071&siteId=4&edId=3&spi=d1eabb20ecd7535c0a9a0783cbb0aca3&pid=10993668&psid=10037157", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\DAPINSTALL.exe")
                Shell("C:\Program Files\Warez-One Package Install Manager\Silent Installation Scripts\Dap.bat")
            Case "iTunes 8"
                My.Computer.Network.DownloadFile _
                ("http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iTunes8/061-5812.20081120.3mv63/iTunesSetup.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\iTunesInstall.exe")
                Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\iTunes.bat")
            Case "Winamp"
                My.Computer.Network.DownloadFile _
                ("http://download.nullsoft.com/winamp/client/winamp5541_full_emusic-7plus_en-us.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\WinampInstall.exe")
                Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\\Winamp.bat")
            Case "Songbird"
                My.Computer.Network.DownloadFile _
                ("http://download.songbirdnest.com/installer/windows/i686-msvc8/Songbird_1.0.0-860_windows-i686-msvc8.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\SongbirdInstall.exe")
                Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Songbird.bat")
            Case "ImgBurn"
                My.Computer.Network.DownloadFile _
                ("http://download.betanews.com/download/1128426215/SetupImgBurn_2.4.2.0.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\ImgBurnInstall.exe")
                Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\ImgBurn.bat")
            Case "UltraISO"
                My.Computer.Network.DownloadFile _
                ("http://dw.ezbsys.net/uiso9_pe.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\UltraISOInstall.exe")
                Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\UltraISO.bat")
            Case "PowerISO"
                My.Computer.Network.DownloadFile _
                ("http://poweriso.com/PowerISO43.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\PowerISOInstall.exe")
                Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\PowerISO.bat")
            Case "mIRC"
                My.Computer.Network.DownloadFile _
                ("http://software-files.download.com/sd/25wSTgb91cXN17hT_oov59TVL6wpK1tbv4mSOGCxafGVwEdnVFbPT_CpEQBHgEUjwyrVGoDny61-l-6N18Vf0lYoVBBnb_FB/software/10897267/10001733/3/mirc635.exe?lop=link&ptype=1901&ontid=2150&siteId=4&edId=3&spi=55ce962657276c9ba80421a23b4a51ef&pid=10897267&psid=10001733", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\mIRCInstall.exe")
                Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\mIRC.bat")
            Case "XChat"
                My.Computer.Network.DownloadFile _
                ("http://www.xchat.org/files/binary/win32/xchat-2.8.7d.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\XChatInstall.exe")
                Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\XChat.bat")
                '--------------------------------------------------------Multimedia------------------------------------------------------------------
        End Select
        '------------------------------------------------------Security-----------------------------------------------------------
        Dim ited As Object

        For Each ited In First_Form.Multimedia_CheckListBox.CheckedItems

        Next
        Select Case ited.ToString()
            Case "Spybot Search & Destroy"
                My.Computer.Network.DownloadFile _
                ("http://www.spybotupdates.com/files/spybotsd160.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\SpyBotInstaller.exe")
                Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\SpyBot.bat")
            Case "Ad-Aware"
                My.Computer.Network.DownloadFile _
                ("http://files3.majorgeeks.com/files/e8aad818fe5983b60b3a41bcc9289803/spyware/aaw2008.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\AAW2008Installer.exe")
                Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Ad-Aware.bat")
            Case "Avast Anti-Virus Home Edition"
                My.Computer.Network.DownloadFile _
                ("http://software-files.download.com/sd/R3itJy7jgChwDxfY60aaqGf7YEKhFUELkkCmKuR-xhWcbjSuz11uZXekhSVCn18Qse11jVIURgdx52Lx7vrmDC1dgNXXfQs-/software/10888427/10019223/3/setupeng.exe?lop=link&ptype=1901&ontid=2239&siteId=4&edId=3&spi=5a3bffed905f4a25419adf4415459fc2&pid=10888427&psid=10019223", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\AvastInstall.exe")
                Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Avast.bat")
            Case ("AVG Anti-Virus Free Edition")
                My.Computer.Network.DownloadFile _
                ("http://avg.vo.llnwd.net/o25/inst/avg_free_stf_en_8_176a1400.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\AVGInstall.exe")
                Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\AVG.bat")
        End Select
        '----------------------------------------------Security--------------------------------------------------------

        '-----------------------------------------------------System---------------------------------------------------
        Dim items As Object
        For Each items In First_Form.System_CheckListBox.CheckedItems
            Select Case items.ToString
                Case "Windows XP Service Pack 3 (XP ONLY)"
                    My.Computer.Network.DownloadFile _
                    ("http://www.microsoft.com/downloads/info.aspx?na=90&p=&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=5b33b5a8-5e76-401f-be08-1e1555d4f3d4&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2fd%2f3%2f0%2fd30e32d8-418a-469d-b600-f32ce3edf42d%2fWindowsXP-KB936929-SP3-x86-ENU.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\WinXPSp3.exe")
                    Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\WINXPSP3.bat")
                Case "Bonjour"
                    My.Computer.Network.DownloadFile _
                    ("http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=21079&cat=59&platform=osx&method=sa/BonjourSetup.exe", "C:\Program Files\Warez-One Install Manager\BonjourInstaller.exe")
                    Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Bonjour.bat")
            End Select
        Next

        '-------------------------------------------Codec Packs-----------------------------------------------------------
        Dim Codecpack As Object
        For Each Codecpack In First_Form.Codecpack_CheckListBox.CheckedItems

        Next
        Select Case Codecpack.ToString
            Case "Community Combined Codec Pack"
                My.Computer.Network.DownloadFile _
                ("http://67.159.45.251/cccp/Combined-Community-Codec-Pack-2008-09-21.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\CCCPInstall.exe")
                Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\CCCP.bat")
            Case "K-Lite Codec Pack"
                My.Computer.Network.DownloadFile _
                ("http://ftp.isu.edu.tw/pub/Windows/softking/soft/en/k/klcodec442f.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\KLCPInstall.exe")
                Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\KLCP.bat")

        End Select

        Me.Finish_Button.Show()
    End Sub

    Private Sub ProgressBar1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InstallationProgressbar.Click

    End Sub
End Class


User is offlineProfile CardPM
+Quote Post


Core
RE: ProgressBar
3 Jan, 2009 - 06:35 PM
Post #2

using DIC.Mod.Core;
Group Icon

Joined: 8 Dec, 2008
Posts: 1,780



Thanked: 139 times
Dream Kudos: 350
Expert In: Software Development, Software Testing/Debugging

My Contributions
Do you need the progress bar to show the progress of the download process?
User is offlineProfile CardPM
+Quote Post

Jarrhed
RE: ProgressBar
3 Jan, 2009 - 09:05 PM
Post #3

D.I.C Head
**

Joined: 1 Jan, 2009
Posts: 61


My Contributions
QUOTE(Core @ 3 Jan, 2009 - 06:35 PM) *

Do you need the progress bar to show the progress of the download process?

I would like the progressbar to work for each selected file, meaning that it would fill i nthe neccesary amount based on the numbe rof programs selected for example, if the 3 programs selected were Mozilla Firefox, iTunes and Songbird it would fill in a 1/3 for each of those programs
User is offlineProfile CardPM
+Quote Post

Core
RE: ProgressBar
3 Jan, 2009 - 09:19 PM
Post #4

using DIC.Mod.Core;
Group Icon

Joined: 8 Dec, 2008
Posts: 1,780



Thanked: 139 times
Dream Kudos: 350
Expert In: Software Development, Software Testing/Debugging

My Contributions
So, it will show the overall download progress for the selected programs? Here is a hint (to be more specific, a formula by which you can calculate the progress, assuming that the maximum value for the progress bar is 100, therefore 100%):

Progress = ((DownloadedFileSize_1 + DownloadedFileSize_2 + DownloadedFileSize_3) * 100) / (TotalFileSize_1 + TotalFileSize_2 + TotalFileSize_3)

DownloadedFileSize_N is the currently downloaded size of the Nth file.

TotalFileSize_N is the downloading file size of the Nth file.
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: ProgressBar
3 Jan, 2009 - 09:34 PM
Post #5

loves.Coding(this);
Group Icon

Joined: 26 Jul, 2007
Posts: 12,288



Thanked: 372 times
Dream Kudos: 10775
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

My Contributions
Let me get this straight, you want our help for finishing your Warez program??!!
User is offlineProfile CardPM
+Quote Post

Jarrhed
RE: ProgressBar
3 Jan, 2009 - 10:27 PM
Post #6

D.I.C Head
**

Joined: 1 Jan, 2009
Posts: 61


My Contributions
Sense you guys both helped me a lot, I would add you in the credits and give you the link to it and source code if you want too

This post has been edited by Jarrhed: 3 Jan, 2009 - 10:27 PM
User is offlineProfile CardPM
+Quote Post

Jarrhed
RE: ProgressBar
4 Jan, 2009 - 03:49 PM
Post #7

D.I.C Head
**

Joined: 1 Jan, 2009
Posts: 61


My Contributions
I still would like some more help o nthis
User is offlineProfile CardPM
+Quote Post

AdamSpeight2008
RE: ProgressBar
4 Jan, 2009 - 04:13 PM
Post #8

The Bandido Coder
Group Icon

Joined: 29 May, 2008
Posts: 1,654



Thanked: 99 times
Dream Kudos: 3350
Expert In: vb.net, LINQ

My Contributions
Hint: Look at Net.WebClient and DownloadFileAsync
User is offlineProfile CardPM
+Quote Post

Amrykid
RE: ProgressBar
4 Jan, 2009 - 06:45 PM
Post #9

D.I.C Regular
Group Icon

Joined: 16 Dec, 2008
Posts: 472



Thanked: 3 times
Dream Kudos: 200
My Contributions
QUOTE(AdamSpeight2008 @ 4 Jan, 2009 - 05:13 PM) *

Hint: Look at Net.WebClient and DownloadFileAsync

dang...i was gonna say that
User is offlineProfile CardPM
+Quote Post

Jarrhed
RE: ProgressBar
4 Jan, 2009 - 06:49 PM
Post #10

D.I.C Head
**

Joined: 1 Jan, 2009
Posts: 61


My Contributions
Its saying that Net.Webclient.DownloadFileAsync isnt a member of System.Net.Webclient and I tried to do it in the progressbar window but it said the same thing just for the progress bar

Just to let you know, I'm extremely beginner self taught vbasic .net and thats the only programming language I somewhat know and I can do bash and batch scripting

BTW if this is suppoed to be used as a method of downloading files, I've been using
CODE
My.Computer.Network.Downloadfile _
("URLHERE", "LOCATION")


This post has been edited by Jarrhed: 4 Jan, 2009 - 06:58 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 7/4/09 07:04PM

Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month