摘要:1、定义委托public delegate int AsynComputeCaller(ulong l, out ulong factorial);2、在委托中加入函数:public int AsynCompute(ulong l, out ulong factorial)AsynComputeCaller caller = new AsynComputeCaller(AsynCompute);3...
阅读全文
摘要:1、将耗时的操作放在单独的线程,加快UI的响应速度。(new Thread(delegate() { parse.ParseDay(StockCodeFileName,market,Overlay); })).Start(); 在主线程A(Form)上新建线程B2、非UI线程操作UI上的控件属性。this.BeginInvoke((ThreadStart)delegate(){tbMessage....
阅读全文
摘要:1、定义public enum DataType : byte { Temperature = 0x81, Humidity = 0x82, O2 = 0x83, CO2 = 0x84, C2H4 = 0x85, }2、填充到comboboxcbbDatatype.Items.AddRange(Enum.GetNames(typeof(DataType)));cbbDatatype.Selecte...
阅读全文