V
Venu
Hi Everyone,
I'm very new to C# and I have the following problem - please help.
I have a Windows Forms application called 'FunApp' which has a status
bar. I also have a separate class library called FunTx compiled as a
DLL.
What I want to do is update the status bar from within a FunTx method -
and I used delegates to try this. Here's what I did.
FunApp
--------
delegate void SetStatusBar(void)
in a method of FunApp, I instantiated this
SetStatusBar sb = new SetStatusBar(SetStatusbarText);
where SetStatusBarText is a method that sets the .Text property of the
status bar.
I do the usual stuff like
FunTx ft = new FunTx();
ft.FunProcess(sb,n);
FunTx (separate class library - DLL)
-----
in FunTx I have a method called FunProcess
public void FunProcess(SetStatusBar sb, int y)
{
.....do something....
sb("And now update the status bar");
}
But nothing happens. No change in status bar. What am I doing wrong?
Any help (other ways to do too) is greatly appreciated.
thanks!
I'm very new to C# and I have the following problem - please help.
I have a Windows Forms application called 'FunApp' which has a status
bar. I also have a separate class library called FunTx compiled as a
DLL.
What I want to do is update the status bar from within a FunTx method -
and I used delegates to try this. Here's what I did.
FunApp
--------
delegate void SetStatusBar(void)
in a method of FunApp, I instantiated this
SetStatusBar sb = new SetStatusBar(SetStatusbarText);
where SetStatusBarText is a method that sets the .Text property of the
status bar.
I do the usual stuff like
FunTx ft = new FunTx();
ft.FunProcess(sb,n);
FunTx (separate class library - DLL)
-----
in FunTx I have a method called FunProcess
public void FunProcess(SetStatusBar sb, int y)
{
.....do something....
sb("And now update the status bar");
}
But nothing happens. No change in status bar. What am I doing wrong?
Any help (other ways to do too) is greatly appreciated.
thanks!