类库中的类如何对窗体中的控件进行操作? 本帖最后由 bulls5988 于 2011-10-14 20:06:20 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以给类加一个事件//类中public event Action<bool> StateChecked;//m_index_dataread函数中if (condition){ if (this.StateChecked != null) { this.StateChecked(true); }}else{ if (this.StateChecked != null) { this.StateChecked(true); }}// 窗体中m_index_read mycard = new m_index_read();mycard.StateChecked += b => b_sales.Enabled = b; 急,急,急,sql语句该怎么样正确写?? F5刷新的问题,在线等待 C#中线程结束时触发事件如何写? 求用鼠标改变panel大小的代码 如何获取桌面,我的文档下的目录及文件,用TREEVIEW显示 当存在多个鼠标时如何让其中的一个工作其他的被屏蔽? B/S自定义性可配置性程序,请大家说说高见,有者有分。 在C#中调用C++类的问题 大家帮我追个女孩子! 文件写入优化 winform中怎么将combox中显示默认的值 Winform奇怪问题那位高手碰到过,关于右键菜单问题!
//类中
public event Action<bool> StateChecked;//m_index_dataread函数中
if (condition)
{
if (this.StateChecked != null)
{
this.StateChecked(true);
}
}
else
{
if (this.StateChecked != null)
{
this.StateChecked(true);
}
}// 窗体中
m_index_read mycard = new m_index_read();
mycard.StateChecked += b => b_sales.Enabled = b;