Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.03.19;
Скачать: CL | DM;

Вниз

Смена цвета кнопки при наведении курсора...   Найти похожие ветки 

 
VitV ©   (2006-02-27 14:13) [0]

Не подскажете как сменять рисунок кнопки(SpeedButton)при наведении на неё курсора.


 
Ega23 ©   (2006-02-27 14:22) [1]

Я бы в Application.OnIdle проверял позицию курсора, и если он над кнопкой, то ...


 
Dmitrij_K   (2006-02-27 14:24) [2]

Вот компонент
OnMouseEnter - наведение курсора
OnMouseLeave - курсор ушел (пить пиво Ж))

unit ExtSpeedButton;

interface

uses
 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
 StdCtrls, Buttons;

type
 TExtSpeedButton = class(TSpeedButton)
 private
   { Private declarations }
   FOnMouseLeave: TNotifyEvent;
   FOnMouseEnter: TNotifyEvent;
   procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
   procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
 protected
   { Protected declarations }
 public
   { Public declarations }
 published
   { Published declarations }
   property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
   property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
 end;

procedure Register;

implementation

procedure Register;
begin
 RegisterComponents("ExtControl", [TExtSpeedButton]);
end;

{ TExtSpeedButton }

procedure TExtSpeedButton.CMMouseEnter(var Message: TMessage);
begin
 if Assigned(FOnMouseEnter) then
   FOnMouseEnter(Self);
end;

procedure TExtSpeedButton.CMMouseLeave(var Message: TMessage);
begin
 if Assigned(FOnMouseLeave) then
   FOnMouseLeave(Self);
end;

end.



 
КаПиБаРа ©   (2006-02-27 14:26) [3]

http://www.yandex.ru/yandsearch?text=CM_MouseEnter&stype=www


 
VitV ©   (2006-02-27 18:21) [4]

Большое спасибо за помощь.



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

Текущий архив: 2006.03.19;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.046 c
2-1141362828
Rubey
2006-03-03 08:13
2006.03.19
Повтор в DBGRID-е


6-1133271863
WebSQLNeeder
2005-11-29 16:44
2006.03.19
Как програмно изменить размеры фрейма вна странице в TWebBrowser


3-1138282885
Stanislav
2006-01-26 16:41
2006.03.19
Передать серверу Application Name


11-1122532585
A_vs
2005-07-28 10:36
2006.03.19
KolListBox


2-1141141601
VitV
2006-02-28 18:46
2006.03.19
Interbase+Delphi+Flash