Click here to Skip to main content
15,890,512 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: visual basic 2010 homework Pin
Pete O'Hanlon14-Jan-14 19:01
mvePete O'Hanlon14-Jan-14 19:01 
QuestionInteracting with Excel: version problem or distribution problem Pin
Steven St. John9-Jan-14 5:14
Steven St. John9-Jan-14 5:14 
AnswerRe: Interacting with Excel: version problem or distribution problem Pin
TnTinMn9-Jan-14 16:07
TnTinMn9-Jan-14 16:07 
GeneralRe: Interacting with Excel: version problem or distribution problem Pin
Steven St. John10-Jan-14 4:32
Steven St. John10-Jan-14 4:32 
GeneralRe: Interacting with Excel: version problem or distribution problem Pin
TnTinMn10-Jan-14 8:58
TnTinMn10-Jan-14 8:58 
GeneralRe: Interacting with Excel: version problem or distribution problem Pin
Steven St. John10-Jan-14 9:53
Steven St. John10-Jan-14 9:53 
AnswerRe: Interacting with Excel: version problem or distribution problem Pin
Steven St. John14-Jan-14 10:31
Steven St. John14-Jan-14 10:31 
Questionfile Downloader Help Pin
Member 105110268-Jan-14 2:15
Member 105110268-Jan-14 2:15 
good day everyone i need help to my project i'm newbie in programming.

i want to make an file downloader using visual basic 2012.

i have a code for file downloader but i need some button to add.

i only have download button1 for (download)to download file.

now i need to add another button2 for (cancel) to stop the download file.

here's the code

Imports System.Net
Public Class Form1


Private Sub downloadFile(ByVal srcPath As String, ByVal destPath As String)
Dim wClient As New System.Net.WebClient()
AddHandler wClient.DownloadProgressChanged, AddressOf downloadFile_ProgressChanged

wClient.DownloadFileAsync(New System.Uri(srcPath), destPath)
End Sub

Private Sub downloadFile_ProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs)

ProgressBar1.Maximum = e.TotalBytesToReceive
ProgressBar1.Value = e.BytesReceived
Label7.Text = e.ProgressPercentage.ToString + "%"
Application.DoEvents()
If e.ProgressPercentage = 100 Then
Label5.Text = "Download Complete :"
DownloadBtn1.Enabled = True
End If
end sub

Private Sub DownloadBtn1_Click(sender As Object, e As EventArgs) Handles DownloadBtn1.Click
If Pm1.SelectedItem = ("item") Then
downloadFile("http://", "Location")
ProgressBar1.Visible = True
Label5.Visible = True
Label7.Visible = True
DownloadBtn1.Enabled = False
End If
end Sub
end class

anybody can edit the code for me

thaks.
AnswerRe: file Downloader Help Pin
Dave Kreskowiak8-Jan-14 3:10
mveDave Kreskowiak8-Jan-14 3:10 
QuestionAnchor Pin
Tsunamipudip8-Jan-14 2:13
Tsunamipudip8-Jan-14 2:13 
AnswerRe: Anchor Pin
Dave Kreskowiak8-Jan-14 3:04
mveDave Kreskowiak8-Jan-14 3:04 
QuestionTrouble with IF...Then...ElseIf... Pin
big_D7-Jan-14 11:36
big_D7-Jan-14 11:36 
AnswerRe: Trouble with IF...Then...ElseIf... Pin
Bernhard Hiller7-Jan-14 20:49
Bernhard Hiller7-Jan-14 20:49 
GeneralRe: Trouble with IF...Then...ElseIf... Pin
big_D8-Jan-14 7:43
big_D8-Jan-14 7:43 
AnswerRe: Trouble with IF...Then...ElseIf... Pin
GuyThiebaut7-Jan-14 21:54
professionalGuyThiebaut7-Jan-14 21:54 
GeneralRe: Trouble with IF...Then...ElseIf... Pin
big_D8-Jan-14 7:44
big_D8-Jan-14 7:44 
QuestionDatagridView not display any data Pin
Biplob Singha Shee6-Jan-14 7:41
Biplob Singha Shee6-Jan-14 7:41 
AnswerRe: DatagridView not display any data Pin
Dave Kreskowiak6-Jan-14 7:55
mveDave Kreskowiak6-Jan-14 7:55 
AnswerRe: DatagridView not display any data Pin
Ron Beyer6-Jan-14 7:58
professionalRon Beyer6-Jan-14 7:58 
GeneralRe: DatagridView not display any data Pin
Biplob Singha Shee6-Jan-14 8:37
Biplob Singha Shee6-Jan-14 8:37 
GeneralRe: DatagridView not display any data Pin
Ron Beyer6-Jan-14 8:58
professionalRon Beyer6-Jan-14 8:58 
GeneralRe: DatagridView not display any data Pin
Biplob Singha Shee6-Jan-14 9:24
Biplob Singha Shee6-Jan-14 9:24 
GeneralRe: DatagridView not display any data Pin
Biplob Singha Shee9-Jan-14 4:56
Biplob Singha Shee9-Jan-14 4:56 
GeneralRe: DatagridView not display any data Pin
Ron Beyer9-Jan-14 5:13
professionalRon Beyer9-Jan-14 5:13 
GeneralRe: DatagridView not display any data Pin
Biplob Singha Shee9-Jan-14 6:28
Biplob Singha Shee9-Jan-14 6:28 

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

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