Click here to Skip to main content
15,912,204 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Experts,

I have a statusstrip with various label-text in my main form. I want to show the a messages on this statusstrip from another form. But can't do.

Kindly help me please.


--- Anil Kumar Bhakta
Posted

Try to create a delegate, Then use it to set it from the calling form.
 
Share this answer
 
Comments
anil_kumar_bhakta 17-Jun-11 12:10pm    
no idea please
There are a couple of ways to address this, but the easiest is to make the statusstrip in the form public.
 
Share this answer
 
You can use the delegate, but more correctly are using interfaces.
For example:

C#
public interface IMessenger
{
    void ShowMessage(string text);
}



And inherit maybe main form, or maybe other classes from this interface.
In the appropriate classes/forms make for example a property 'Messenger', set it and use. This way is more flexible than delegates.
 
Share this answer
 
Comments
anil_kumar_bhakta 17-Jun-11 12:10pm    
no idea please

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900