Bonjour,
pour créer un effet de HighLight sur un BitBtn en changeant son image au survol de la souris, j'ai intégré ce code :
Cela fonctionne, mais quand je déplace la souris assez rapidement, le bouton scintille.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 ... private { Déclarations privées } procedure AppMessage(var Msg:TMsg;var Handled:Boolean); ..... procedure TF_Princ.FormCreate(Sender: TObject); Begin Application.OnMessage:=AppMessage ; ... { ================================================================== } Procedure TF_Princ.AppMessage(var Msg: TMsg; var Handled: Boolean); Var AControl:TControl; APoint:TPoint; Begin If Msg.message =WM_MOUSEMOVE then Begin BBtn_Jouer.Glyph.Handle := LoadBitMap(HInstance, PChar('BT_Jouer1')) ; AControl:=F_Princ.ControlAtPos(ScreenToClient(Mouse.CursorPos),false,true); If AControl<>nil then Begin If (AControl.Name = 'BBtn_Jouer') Then BBtn_Jouer.Glyph.Handle := LoadBitMap(HInstance, PChar('BT_Jouer2')) ; End ; End; End; { ================================================================== }
Pourriez vous me dire si on peut l'éviter ? on s'il y a une autre méthode pour gérer le survol du bouton.
Merci
A+
Charly
Partager