Показать сообщение отдельно
  #1  
Старый 21.04.2012, 20:41
Старый Старый вне форума
Прохожий
 
Регистрация: 09.10.2009
Сообщения: 3
Репутация: 10
По умолчанию

Цитата:
Сообщение от Yurk@
не, прийдется перебирать всё

Спасибо за помощь, вот что получилось.
Код:
var 
 i:integer;  
 p:TPoint; 
 myCursorPos: TPoint;
begin      
 myCursorPos:= Mouse.CursorPos;
 for i:=0 to ComponentCount-1 do begin
  if not (Components[i] is TWinControl) then Continue;
  with TWinControl(Components[i]) do begin
   p:=ClientToScreen(Point(0,0));
   if
    (myCursorPos.X>=p.X)and(myCursorPos.Y>=p.Y) and
    (myCursorPos.X<=(p.X+Width))and(myCursorPos.Y<=(p.Y+Height)) then
   begin
    компонент с именем Name под мышкой
   end
  end;
 end;
end;
Ответить с цитированием