[SOLVED] change state ?!?! lazarus / 31-LCL ---------------------------------------------------------------------- majid.ebru · 2022-03-06 14:16 Hi i use a panel . i write when that i press on the panel i change shape : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TMainForm.btn_sampleMouseUp(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin...          BevelOuter := bvRaised;...end;   this code is good when i don't move the mouse. when the mouce cursor is on the panel this code work good. but when i press on the panel and i move the cursor out of the panel , this code work alos. i want when cursor muose is exact on the panel , the code work?!?! can someone help or guide me. thkx ---------------------------------------------------------------------- winni · 2022-03-06 14:36 Hi! MouseUp event is called for the component where the Mouse resides. So you should use MouseDown instead. Winni ---------------------------------------------------------------------- majid.ebru · 2022-03-07 05:36 Quote from: jamie on March 06, 2022, 05:40:56 pmor if they want to keep with this. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Panel1MouseUp(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);var  R:TRect;begin  With Sender as TPanel do   begin     GetWindowRect(Handle,R);   //include the LCLIntF in the uses.     If PtInRect(R,Mouse.CursorPos)       Then BevelOuter := bvRaised Else        BevelOuter := bvLowered;   end;end;               Thank you