private void MainForm_Load(object sender, EventArgs e) { this.ctrl = new DemoBrowserCtrl(); this.ctrl.setWithinSwingCtrlHelper(this); this.listBrowser = new JWebTopBrowser(); this.detailBrowser = new JWebTopBrowser(); ctx.setJsonHandler(this.ctrl); listBrowser.Dock = System.Windows.Forms.DockStyle.Fill; detailBrowser.Dock = System.Windows.Forms.DockStyle.Fill; this.splitMain.Panel1.Controls.Add(listBrowser); this.splitMain.Panel2.Controls.Add(detailBrowser); // 注意:一定要在新线程中进行创建操作,否则会和C#的死锁(难道Form.Load事件是从WndProc中发出的,然后和JWebTopDLL中sendMessage冲突了???) Thread th = new Thread(new ThreadStart(createBrowser)); //也可简写为new Thread(ThreadMethod); th.Start(); //启动线程 }
public ListBrowserCreated(DemoBrowserCtrl ctrl) { this.ctrl = ctrl; }
private void MainForm_Load(object sender, EventArgs e) { this.ctrl = new DemoBrowserCtrl(); this.ctrl.setWithinSwingCtrlHelper(this); this.listBrowser = new JWebTopBrowser(); this.detailBrowser = new JWebTopBrowser(); ctx.setJsonHandler(this.ctrl); listBrowser.Dock = System.Windows.Forms.DockStyle.Fill; detailBrowser.Dock = System.Windows.Forms.DockStyle.Fill; this.splitMain.Panel1.Controls.Add(listBrowser); this.splitMain.Panel2.Controls.Add(detailBrowser); // ע�⣺һ��Ҫ�����߳��н��д���������������C#���������ѵ�Form.Load�¼��Ǵ�WndProc�з����ģ�Ȼ���JWebTopDLL��sendMessage��ͻ�ˣ������� Thread th = new Thread(new ThreadStart(createBrowser)); //Ҳ�ɼ�дΪnew Thread(ThreadMethod); th.Start(); //����߳� }