LAMW UI questions lazarus / 43-Android ---------------------------------------------------------------------- CC · 2017-09-25 14:02 Hi, 1. I need to change its  color when a button is clicked to mimic grouped button behaviour  (always only one is selected). Trying to change the color  within the eventhandler crashes  the app.  Is there a way to do  this properly? 2. Z Order has no effect. Is there a way to insure that a  control appears on  top of an other when overlapped. ---------------------------------------------------------------------- RAW · 2017-09-25 15:11 1) How does the unproperly way look like?     OS ? LAZ version ? 2) What's wrong with 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 Control.BringToFront; ---------------------------------------------------------------------- Thaddy · 2017-09-25 16:52 Note you may not be able to change the color on every widgetset for TButton: e.g. on windows that is not possible. ---------------------------------------------------------------------- CC · 2017-09-25 16:53 I forgot to mention a very important piece of information : I am using LAMW.  QuoteHow does the unproperly way look like? Trying to change the color  within the on click event handler crashes  the app.  The process of handling a click involves some UI updates after the event handler code is executed. So I assumed  that changing a  property value it uses  caused the crash.  Maybe my code needs to be wrapped between some kind of  "Begin update" and  "End update"  calls. ---------------------------------------------------------------------- jmpessoa · 2017-09-25 18:21 QuoteI forgot to mention a very important piece of information : I am using LAMW.  Please, add "LAMW:" in your subject ... Ok. I will try some solution! Thank you! ---------------------------------------------------------------------- jmpessoa · 2017-09-26 23:50 Hi, CC This work: 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 TAndroidModule1.jButton1Click(Sender: TObject);begin  jButton1.Enabled:= False;end; procedure TAndroidModule1.jButton2Click(Sender: TObject);begin  jButton1.Enabled:= True;end;  and this, too: 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 TAndroidModule1.jButton1AfterDispatchDraw(Sender: TObject; canvas: JObject; tag: integer);begin  if jButton1.Enabled = False then     jButton1.BackgroundColor:= colbrYellow  else    jButton1.BackgroundColor:= colbrRed;end;  NOTE: Fixed jButton Enable property in design time.... ---------------------------------------------------------------------- CC · 2017-10-22 12:06 jmpessoa, I have just realized, that for some reason my "Thank you" comment  did not make into the topic earlier. So once again: Thank you for creating LAMW and for your quick response. Your solution works. There is small time-lag though, so I ended up putting every button into its own panel and coloring the parent instead. There is no delay this way.