Question Start Download in Another Form

Applicsn0w

New member
Joined
May 26, 2011
Messages
1
Programming Experience
1-3
Hello guys,
I have a serious problem.
I've made a download manager, which made out of several form.
I have a problem with the first and second form, they are the mainly forms.
The first is the main window. It contains the ListView, where you see the downloads, and buttons and etc.
The second window is the window you insert the download link and press to download the file.

I made everything, but when you press on the start button in the second window, it closes (as I wrote it to) and doesn't start the download.

To check if it starts or not, I made a timer, which starts when the download begins, and it should show the seconds in a cell on the chart.

It doesn't start it.

I used this two lines to start download (the are in the button1_click in the second window):
VB.NET:
[FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Form1[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].download = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]WebClient[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]Form1.download.DownloadFileAsync([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Uri[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2](TextBox1.Text), Options.TextBox1.Text + [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"\"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] + [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"123.exe"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2])[/SIZE][/FONT]
[/SIZE][/FONT]
Download is a public event and webclient.
Textbox1 is where the link is (direct link - if you put it in the adress in the browser, it starts downloading the file).
Options.Texbox1 is the path (another window)

The code of showing it in the listview is:
VB.NET:
[FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]Form1.listview.Items(Counter).SubItems.Add(e.ProgressPercentage + [COLOR=darkred]" %"[/COLOR][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2])[/SIZE][/FONT]
[/SIZE][/FONT]
Counter is an Integer that raise in 1 every click in the second form (to be able to make another row, for multiple downloads.

Please help me guys!

Thanks :)
 
Back
Top