问个问题,求帮忙.
C#中一个窗体如何向另外一个窗体发送消息.
比如按下窗体A中的按钮时,如何发送一个消息给窗体B,执行窗体B中的按钮被按下的效果
谢一个先.

解决方案 »

  1.   

    将窗体B的按钮设为public static ,按下A窗体的按钮时调用B的static 按钮
      

  2.   

    (1)you can send message by event. you can define an event and then trigger it, hehe
    (2)I think the solution is the best solution, if you do not like it, maybe you can invoke API to send the message
      

  3.   

    使用system.windows.form空间下的beginInvoke方法,在子窗体中添加一个委托,然后在父窗体添加处理函数,然后再将父窗体的处理函数添加到子窗体的委托中,具体的操作可以看
    msdn,里面有详细的讲解.