当前位置: 代码迷 >> C# >> 多句语句怎么用lambda写
  详细解决方案

多句语句怎么用lambda写

热度:71   发布时间:2016-05-05 03:55:25.0
多句语句如何用lambda写
如题
原先这样的 用匿名委托 写两句话用分号隔开的

this.Dispatcher.Invoke(delegate 
         { 
            MessageBox.Show("ok"); 
            this.pb1.Value = 0; 
         });


现在两句话如何隔离

 this.Dispatcher.Invoke(()=>
            MessageBox.Show("ok")
            this.pb1.Value = 0
         );

------解决思路----------------------
this.Dispatcher.Invoke(()=>{
            MessageBox.Show("ok");
            this.pb1.Value = 0;}
         );

这是送分题么……