Click here to Skip to main content
15,900,511 members
Home / Discussions / C#
   

C#

 
QuestionHow do I use my written Help(html) to my project? Pin
F.Hashemi22-Feb-06 0:10
F.Hashemi22-Feb-06 0:10 
QuestionSettings Pin
Dave McCool21-Feb-06 23:32
Dave McCool21-Feb-06 23:32 
QuestionChange OpenFileDialog Pin
Anindya Chatterjee21-Feb-06 23:15
Anindya Chatterjee21-Feb-06 23:15 
AnswerRe: Change OpenFileDialog Pin
Andy Moore22-Feb-06 3:48
Andy Moore22-Feb-06 3:48 
QuestionTwo Threads accessing and modifying SQL database at the same time Pin
emran83421-Feb-06 22:24
emran83421-Feb-06 22:24 
AnswerRe: Two Threads accessing and modifying SQL database at the same time Pin
Curtis Schlak.2-Mar-06 12:58
Curtis Schlak.2-Mar-06 12:58 
QuestionAutomatically getting progress from Background worker Pin
emran83421-Feb-06 22:19
emran83421-Feb-06 22:19 
AnswerRe: Automatically getting progress from Background worker Pin
StyleGuide21-Feb-06 22:49
StyleGuide21-Feb-06 22:49 
Hi Emran,

The following gets the progress on interating thru Controls on a form....Something like :

private int progressBarIndex;

private void StartWorker()
{

//Set progress Bar stuff before running thread
this.myBar.Value = 0;
this.myBar.Minimum = 0;
this.myBar.Maximum = 100;
//Set the thread going
this.worker.WorkerReportsProgress = true;
this.worker.RunWorkerAsync(this.Controls.Count);
}

private void LoopThruControls()
{

foreach (Control control in this.Controls)
{
Console.WriteLine(control.Name.ToString());
//Update progress
this.workerReportProgress();

}
}

private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
{
//Call this method when thread begins
this.LoopThruControls();
}


private void backgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
//Update the progress bar
System.Diagnostics.Debug.Assert(InvokeRequired == false);
this.myBar.Value = e.ProgressPercentage;
}

private void workerReportProgress()
{
this.progressBarIndex++;
this.worker.ReportProgress(progressBarIndex);
}

.. then use worker_RunWorkerCompleted to Finish..

HTH

Jonny
GeneralRe: Automatically getting progress from Background worker Pin
emran83421-Feb-06 23:07
emran83421-Feb-06 23:07 
GeneralRe: Automatically getting progress from Background worker Pin
J4amieC21-Feb-06 23:24
J4amieC21-Feb-06 23:24 
GeneralRe: Automatically getting progress from Background worker Pin
emran83421-Feb-06 23:32
emran83421-Feb-06 23:32 
GeneralRe: Automatically getting progress from Background worker Pin
StyleGuide21-Feb-06 23:44
StyleGuide21-Feb-06 23:44 
GeneralRe: Automatically getting progress from Background worker Pin
emran83422-Feb-06 0:01
emran83422-Feb-06 0:01 
GeneralRe: Automatically getting progress from Background worker Pin
J4amieC22-Feb-06 0:18
J4amieC22-Feb-06 0:18 
GeneralRe: Automatically getting progress from Background worker Pin
StyleGuide22-Feb-06 1:51
StyleGuide22-Feb-06 1:51 
GeneralRe: Automatically getting progress from Background worker Pin
emran83422-Feb-06 15:08
emran83422-Feb-06 15:08 
QuestionC# DataGridView Cell Focus Pin
StyleGuide21-Feb-06 22:06
StyleGuide21-Feb-06 22:06 
AnswerRe: C# DataGridView Cell Focus Pin
StyleGuide21-Feb-06 22:52
StyleGuide21-Feb-06 22:52 
Questionconverting string to byte Pin
leelaraj21-Feb-06 21:55
leelaraj21-Feb-06 21:55 
GeneralRe: converting string to byte Pin
leppie21-Feb-06 22:40
leppie21-Feb-06 22:40 
AnswerRe: converting string to byte Pin
Le centriste22-Feb-06 1:20
Le centriste22-Feb-06 1:20 
AnswerRe: converting string to byte Pin
User 665822-Feb-06 1:25
User 665822-Feb-06 1:25 
QuestionHow do I use one form showing to different look Pin
Tony_Joh21-Feb-06 20:28
Tony_Joh21-Feb-06 20:28 
AnswerRe: How do I use one form showing to different look Pin
Vikram A Punathambekar21-Feb-06 21:20
Vikram A Punathambekar21-Feb-06 21:20 
GeneralRe: How do I use one form showing to different look Pin
Tony_Joh21-Feb-06 22:20
Tony_Joh21-Feb-06 22:20 

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.