Luis Devis Posted July 5, 2021 Share Posted July 5, 2021 Hola, gracias por interesarte. Necesito que un panel cambie de color cuando se pulsa sobre el y recupere el color original cuando se suelta el raton o el dedo. No quiero hacerlo via código porque es muy lento, me gustaria usar ClientEvents pero estoy muy verde en eso. Muchas gracias por tu ayuda Quote Link to comment Share on other sites More sharing options...
Luis Devis Posted July 7, 2021 Author Share Posted July 7, 2021 Finalmente este es el resultado que me dieron, y funciona. Okay. Try this approach. 1. Uses ... , UniGUIJSUtils; 2. procedure TMainForm.UniFormCreate(Sender: TObject); begin with UniPanel1 do JSInterface.JSAssign('originalBGColor', [uniColor2Web(Color)]); end; 3. UniPanel1 -> ClientEvents -> ExtEvents -> function mousedown(sender, x, y, eOpts) { sender.setBodyStyle('background-color', 'green'); } function mouseup(sender, x, y, eOpts) { sender.setBodyStyle('background-color', sender.originalBGColor); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.