本文介绍了状态条标签文字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,专家,
我的主要表单中有一个带有各种标签文本的状态条.我想通过另一种形式在此statusstrip上显示一条消息.但是不能.
请帮助我.
--- Anil Kumar Bhakta
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
推荐答案
public interface IMessenger
{
void ShowMessage(string text);
}
并从此接口继承主形式或其他类.
在适当的类/表单中,例如设置属性"Messenger",进行设置和使用.这种方式比委托人更灵活.
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.
这篇关于状态条标签文字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!