hello folks,
i have a small issue while developing a windows application using VB.Net . i will explain the scenario here.
My application contains one form which has two tab buttons. say tab1 and tab2. In tab1, i have an option to download data from various sites. this takes few minutes. lets say 15 minutes. and in tab2 i have an option to view the logs.
my problem is i am unable to click the tab2 unless and untill the downloading finish. my doubt is how to do more than processes at the same time. if i am right we need to use threading concept here. but i have no clue how to implement it.
so guys i am expecting wise advice from ur side.
i will give you more idea if u r not clear with my problem
thanks in advance
shyam
Loading

Kirtan PatelRank #292 · 8.6K reputationPosted Jul 30, 2009, 12:28 AM EDT
Create new Thread for Executing that method this will not Freeze other tab
or
One another solution to your problem
Download your file With
private void Form1_Load(object sender, EventArgs e) { WebClient wc = new WebClient(); wc.DownloadFileAsync("url","filename"); }Happy Coding :)
shyam kumar15 reputationPosted Jul 30, 2009, 1:42 AM EDT
here i can not use web client, instead i am using microsoft html object library and microsoft internet controls.
in tab 2 i have a download button which downloads statements from different bank portals and in the second tab i have grid where i can see the logs.
can you give me codes how to implement multi threading here
regrads
shyam
Kirtan PatelRank #292 · 8.6K reputationPosted Jul 30, 2009, 2:37 AM EDT
using System.Threading;
Thread t1; public Form1() { InitializeComponent(); } private void DownloadButton1_Click(object sender, EventArgs e) { if (t1.ThreadState == ThreadState.Aborted) { t1 = new Thread(DownloadMethod); t1.Start(); } } public void DownloadMethod() { // Method For Downloading Content //AfterCompleting Download Call t1.Abort(); }Now your Download Method Will run in Separate Process and Normal Processing will run in Another Process .
Thats it :)
Happy Coding :)
shyam kumar15 reputationPosted Jul 30, 2009, 9:33 PM EDT
your solution did not help me. i am using vb.net. can anybody give me sample application with tabs an multithreading implemented on it
plzzz
Kirtan PatelRank #292 · 8.6K reputationPosted Jul 30, 2009, 10:33 PM EDT
Download Sample Code