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;
阅读(2666) | 评论(0) | 转发(0) |