GUIとは別スレッドからGUI要素を変更する時
Form.Invoke()というメソッドでやらないとスレッドのデッドロックが起こるので
こうとか
MethodInvoker d = delegate() { textBoxMsg.Text += "hogehoge"; };
this.Invoke(d);
こう書くと1行で書ける
this.Invoke((MethodInvoker) delegate() { textBoxMsg.Text += "hogehoge"; });
なんか引数なしのdelegateとか、引数stringだけのdelegateとか作ったり
GUI要素1個変えるだけの関数を大量に作ったりしてたけどこれですっきりする。
--
橋本 翔(Sho Hashimoto)
sho...@sfc.keio.ac.jp
http://shokai.org/