procedure TForm1.StatusBar1DblClick(Sender: TObject);
var
I, X, n, m: Integer;
begin
with Sender as TStatusBar do begin
X := ScreenToClient(Mouse.CursorPos).X;
n := 0;
for I := 0 to Panels.Count - 1 do begin
if I = Panels.Count - 1 then m := Width //最后一个Panel的Width没有意义
else m := Panels[I].Width;
n:=n+m;
if (n > x) then begin
showmessage(timetostr(now)+' 第'+inttostr(I)+'个 '+Panels[I].Text);
Break;
end;
end;
end;
end;
阅读(2933) | 评论(0) | 转发(0) |