[Solved] MouseDown in GraphicControl lazarus / 31-LCL ---------------------------------------------------------------------- lainz · 2011-10-02 19:11 I have a question, I'm using TGraphicControl and there is no 'Focused' function. I've solved that problem adding this code: Code: [Select]procedure TBGRACustomGraphicButton.MouseUp(Button: TMouseButton;   Shift: TShiftState; X, Y: integer); begin   DoButtonUp;   inherited MouseUp(Button, Shift, X, Y); end;       procedure TBGRACustomGraphicButton.DoButtonUp; var   NewState: TButtonState;   p: TPoint; begin   p := ScreenToClient(Mouse.CursorPos);   if (p.x >=0) and (p.x <= Width) and (p.y >=0) and (p.y <= Height) then     NewState := bsHot   else     NewState := bsUp;   if NewState <> FState then   begin     FState := NewState;     Invalidate;   end; end; It works for the thing I want: when the button is pressed and I leave the button area and 'up' the button the image shown is the bsUp (Normal state) and not the bsHot (Mouse enter). My question is if you know some other way or if this is really ok? ---------------------------------------------------------------------- felipemdc · 2011-10-02 19:17 Quote from: lainz on October 02, 2011, 09:11:40 pmI have a question, I'm using TGraphicControl and there is no 'Focused' function. I've solved that problem adding this code: That a TGraphicControl has no Focused property is not a missing feature or an oversight, it a major part of this kind of control. Attempting to work around this is not a good idea ... you should really use TCustomControl if you want a control which can receive focus. In general in the LCL you can choose between 2 options: 1> TCustomControl -> Can receive focus, can only have transparent areas by using the property setShape 2> TGraphicControl -> Cannot receive focus, can easy have transparent areas by simply not painting. So, summing it up, if you don't need the easy transparency from TGraphicControl then you should use TCustomControl. ---------------------------------------------------------------------- lainz · 2011-10-02 19:47 Ok at this moment it uses alpha blended images and it's used at top of images but thanks for the info. I've another question but I will put it in a separate thread