Вниз
Скачать: CL | DM;

Label как ссылка.   Найти похожие ветки 

 
Alexis ©   (2004-04-10 19:33) [0]

Подскажите, как при наведении курсора мышки на Label, текст Label"а подсвечивать к примеру синим, подчеркивать его и изменять курсор мышки, т.е. сделать поведение, как у link.
Заранее благодарю.


 
Jack128 ©   (2004-04-10 19:44) [1]

Подобные компоненты уже есть, поищи.
Если же хочешь сам, то нужно обработать cm_mouseleave/cm_mouseenter (для подсветки цветом)и в OnClick обрабочике написать ShellExecute(0, nil, "http://www.delphimaster.ru", nil, nil, SW_SHOW);


 
Alexis ©   (2004-04-10 20:03) [2]


Если же хочешь сам, то нужно обработать cm_mouseleave/cm_mouseenter

Пример можно? Уж не hook"и ли надо использовать?


 
TButton ©   (2004-04-10 20:09) [3]

нет. обработку сообщений.


 
Jack128 ©   (2004-04-10 20:31) [4]

type
TLinkLabel = class(TLabel)
private
 FLink: string;
 procedure CMMouseEnter(var Message: TMessage); message cm_mouseenter;
 procedure CMMouseLeave(var Message: TMessage); message cm_mouseleave;
protected
 procedure Click; override;
published
 property Link: string read FLink write FLink;
end;

{ TLinkLabel }

procedure TLinkLabel.Click;
begin
 inherited;
 if not (csDesigning in ComponentState) and (FLink <> "") then
   ShellExecute(0, nil, PChar(FLink), nil, nil, SW_SHOW);
end;

procedure TLinkLabel.CMMouseEnter(var Message: TMessage);
begin
 inherited;
 Font.Color := СветлоГолубой;
end;

procedure TLinkLabel.CMMouseLeave(var Message: TMessage);
begin
 inherited;
 Font.Color := Синий;
end;



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.031 c
1-1081417685
Dysan
2004-04-08 13:48
2004.04.25
TTreeView


1-1081603160
DADUD
2004-04-10 17:19
2004.04.25
Определение ошибок в ZLib


14-1080742667
juiceman
2004-03-31 18:17
2004.04.25
Тоже ищу программу, даже две


14-1081151876
syte_ser78
2004-04-05 11:57
2004.04.25
Запрограмировался. :)


11-1063861417
AndrewA
2003-09-18 09:03
2004.04.25
Несоответствие в TrimLeft




   Наверх