全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:941
推到 Plurk!
推到 Facebook!

Responding to mouse-down messages

尚未結案
max23
一般會員


發表:1
回覆:0
積分:0
註冊:2002-10-21

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-01-17 16:18:48 IP:203.69.xxx.xxx 未訂閱
Responding to mouse-down messages 我的元件必須隱藏繼承元件的MouseDown事件,並在我自已的MouseDown事件中 處理一些事,我在help裡找到下面的說明,不過我照它的方法還是有問題,請 問還有那邊有問題嗎????? A MouseDown method is a protected method for a controls OnMouseDown event. The control itself calls MouseDown in response to a Windows mouse-down message. When you override the inherited MouseDown method, you can include code that provides other responses in addition to calling the OnMouseDown event. To override MouseDown, add the MouseDown method to the TDBCalendar class: class PACKAGE TDBCalendar : public TSampleCalendar { ... protected: virtual void __fastcall MouseDown(TMouseButton Button, TShiftState Shift, int X, int Y); ... }; Write the MouseDown method in the .CPP file: void __fastcall TDBCalendar::MouseDown(TMouseButton Button, TShiftState Shift, int X, int Y) { TMouseEvent MyMouseDown; // declare event type if (!FReadOnly && FDataLink->Edit()) // if the field can be edited TSampleCalendar::MouseDown(Button, Shift, X, Y); // call the inherited MouseDown else { MyMouseDown = OnMouseDown; // assign OnMouseDown event if (MyMouseDown != NULL) MyMouseDown(this, Button, // execute code in the... Shift, X, Y); // ...OnMouseDown event handler } } When MouseDown responds to a mouse-down message, the inherited MouseDown method is called only if the control ReadOnly property is false and the data link object is in edit mode, which means the field can be edited. If the field cannot be edited, the code the programmer put in the OnMouseDown event handler, if one exists, is executed.
系統時間:2024-04-27 3:40:12
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!