Re: BackgroundWorker not working...
From: Carsten Marx (Carsten.Marx_at_uni-konstanz.de)
Date: 01/11/05
- Next message: Rob Thomson: "ComboBox"
- Previous message: Sergey Bogdanov: "Re: Bluetooth printing"
- In reply to: Daniel Moth: "Re: BackgroundWorker not working..."
- Next in thread: Daniel Moth: "Re: BackgroundWorker not working..."
- Reply: Daniel Moth: "Re: BackgroundWorker not working..."
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 11 Jan 2005 19:36:28 +0100
ok, my fault....
now here my code:
// Call this method in form's ctor
private void InitBW()
{
mBW = new BackgroundWorker(this);
mBW.RunWorkerCompleted += new
RunWorkerCompletedEventHandler(mBW_RunWorkerCompleted);
mBW.ProgressChanged += new
ProgressChangedEventHandler(mBW_ProgressChanged);
mBW.DoWork += new DoWorkEventHandler(mBW_DoWork);
mBW.WorkerReportsProgress = true;
mBW.WorkerSupportsCancellation = true;
}
// Completion event
private void mBW_RunWorkerCompleted(object sender,
RunWorkerCompletedEventArgs e)
{
this.pgBar.Hide();
}
// Progress event
private void mBW_ProgressChanged(object sender,
ProgressChangedEventArgs e)
{
this.pgBar.BringToFront();
this.pgBar.Value = e.ProgressPercentage;
}
// On worker thread! Only method with real logic
private void mBW_DoWork(object sender, DoWorkEventArgs e)
{
this.refreshView();
}
/// <summary>
/// manage the click on the TYP button
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void bTYP_Click(object sender, EventArgs e)
{
this.activeCategory = "TYP";
this.resetActiveCategory();
this.BackColor = Preferences.COLOR_CATEGORY_TYP;
this.refreshView();
}
the method refreshView handles some stuff to load data and managa the gui...
whats wrong?
Daniel Moth wrote:
> In .NET projects (desktop of CF) adding a reference to a class library is
> the first step for using the code in the dll.
>
> The second step is to show your intent in the code file that you will be
> using types from the namespace(s) in the said dll.
>
> In this case this means the ComponentModel namespace.
>
> Try inserting the following line at the top of your file:
> using System.ComponentModel;
> or in VB:
> Imports System.ComponentModel
>
> Let me know if you are still having problems and I do recommend downloading
> the sample I pointed out (you would have found this on your own then :-)
>
> Cheers
> Daniel
> --
> http://www.danielmoth.com/Blog/
>
>
> "Carsten Marx" <Carsten.Marx@uni-konstanz.de> wrote in message
> news:%23GoRl9$9EHA.2196@TK2MSFTNGP14.phx.gbl...
>
>>Daniel Moth wrote:
>>
>>>Can you share the client code and describe what "does not working" mean?
>>>
>>>There is a sample here:
>>>http://www.danielmoth.com/Blog/2004/12/backgroundworker-sample.html
>>>
>>>Cheers
>>>Daniel
>>>--
>>>http://www.danielmoth.com/Blog/
>>>
>>>
>>>"Carsten Marx" <Carsten.Marx@uni-konstanz.de> wrote in message
>>>news:%23UN5f2$9EHA.2540@TK2MSFTNGP09.phx.gbl...
>>>
>>>
>>>>Hello,
>>>>i tried to create an instance of the BackgroundWorker
>>>>http://www.danielmoth.com/Blog/2004/12/backgroundworker-for-cf-10.html
>>>>after adding the dll to my Projekt.
>>>>But it's not working... Whats wrong?
>>>>
>>>>regards
>>>>carsten
>>>
>>>
>>>
>>[ Der Typ oder Namespace 'BackgroundWorker' konnte nicht gefunden werden.
>>Möglicherweise fehlt eine Anweisung oder ein Assemblyverweis.]
>>..sorry german..
>>In English it should be:
>>The type or namespace "BackgroundWorker" could not be found....
>>
>>
>>regards carsten
>>
>>btw: the dll is added to the project...
>
>
>
- Next message: Rob Thomson: "ComboBox"
- Previous message: Sergey Bogdanov: "Re: Bluetooth printing"
- In reply to: Daniel Moth: "Re: BackgroundWorker not working..."
- Next in thread: Daniel Moth: "Re: BackgroundWorker not working..."
- Reply: Daniel Moth: "Re: BackgroundWorker not working..."
- Messages sorted by: [ date ] [ thread ]