Вниз
Скачать: 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 вся ветка

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



Память: 0.45 MB
Время: 0.026 c
1-1139576709
StriderMan
2006-02-10 16:05
2006.03.19
Как сдлать прозрачным WinControl?


15-1141075073
Grief
2006-02-28 00:17
2006.03.19
Оригинально!


15-1140700633
SergP.
2006-02-23 16:17
2006.03.19
PHP & Oracle. Помогите выполнить блок


4-1135243373
bobah
2005-12-22 12:22
2006.03.19
Прерывание процесса установки модемного соединения.


2-1141129418
Alexsan
2006-02-28 15:23
2006.03.19
Принтер




   Наверх