日期:2014-05-18 浏览次数:20861 次
namespace AccessTest { public partial class Form1 : Form { //public delegate void setCap(string caption); public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { ThreadStart st = new ThreadStart(new DBio().Work); Thread t = new Thread(st); t.Start(); } public void setLog(string cap) { this.Text = cap; } } public class DBio { public void Work() { 改写Form1.Text,这里应该这么写呢? } } }
Form prform;//主窗体 private void FormShow() { switch (re_message) { ............ } } MethodInvoker mi = new MethodInvoker(FormShow); prform.BeginInvoke(mi);