懒 懒少爷 Unregistered / Unconfirmed GUEST, unregistred user! 2006-02-17 #1 我在线程里用了控件,如何再用这控件的事件呢? 如我用了ADOQuery1,如何用这个ADOQuery1的BeforeInsert事件呢? 谢谢!
Y yanghai0437 Unregistered / Unconfirmed GUEST, unregistred user! 2006-02-18 #2 ADOQuery1.onBeforeInsert=你自己定义的过程
C chen_liang Unregistered / Unconfirmed GUEST, unregistred user! 2006-02-18 #3 直接在ADOQuery1的onBeforeInsert事件添加你的代码就可以啊
L lxw5214 Unregistered / Unconfirmed GUEST, unregistred user! 2006-02-18 #4 同意yanghai0437,我也是这么做的,自己写个过程,然后ADOQuery1.OnBeforeInsert:=自定义过程
L lxw5214 Unregistered / Unconfirmed GUEST, unregistred user! 2006-02-18 #5 例如:在线程里定义一个和控件的事件一样的过程,并实现他 private Comm1ReceiveData(Sender: TObject; Buffer: Pointer; BufferLength: Word); end; implementation constructor TPollingThread.Create(Createsuspended: Boolean); begin Comm1.OnReceiveData := Comm1ReceiveData; end; procedure TPollingThread.Comm1ReceiveData(Sender: TObject; Buffer: Pointer; BufferLength: Word); begin //your code; end;
例如:在线程里定义一个和控件的事件一样的过程,并实现他 private Comm1ReceiveData(Sender: TObject; Buffer: Pointer; BufferLength: Word); end; implementation constructor TPollingThread.Create(Createsuspended: Boolean); begin Comm1.OnReceiveData := Comm1ReceiveData; end; procedure TPollingThread.Comm1ReceiveData(Sender: TObject; Buffer: Pointer; BufferLength: Word); begin //your code; end;
懒 懒少爷 Unregistered / Unconfirmed GUEST, unregistred user! 2006-02-27 #6 谢谢,还未试过,先给分. CHEN_LIANG说的和答案似相差较远,所以只给5分.另两位只按我的感觉分配分数了.不公平对不起呀