CheckListView 的運行原理 |
尚未結案
|
turboted
版主 發表:95 回覆:754 積分:452 註冊:2002-07-23 發送簡訊給我 |
|
Royce520
高階會員 發表:18 回覆:157 積分:100 註冊:2002-09-13 發送簡訊給我 |
turboted 你好,
你說的這部份的VCL判斷程式碼在 checklst.pas 中,
我將他節錄出來, 如下: procedure TCheckListBox.MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
var
Index: Integer;
begin
inherited;
if Button = mbLeft then
begin
Index := ItemAtPos(Point(X,Y),True);
if (Index <> -1) and GetItemEnabled(Index) then
if not UseRightToLeftAlignment then
begin
// 這裡就是判斷是否click 在 check 上還是之外. 如果是的話,
還會執行你在 Events 所指定到 OnClickCheck 的工作
if X - ItemRect(Index).Left < GetCheckWidth then
ToggleClickCheck(Index)
end
else
begin
Dec(X, ItemRect(Index).Right - GetCheckWidth);
if (X > 0) and (X < GetCheckWidth) then
ToggleClickCheck(Index)
end;
end;
end; 我想應該沒錯吧
------
不要忘記呼吸,不要忘記編程! ∩__∩ |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |