Detecting if a form is Active ? lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- Josh · 2016-09-27 19:31 Hi, I am trying to determine which form in a multiform has got focus; I have a timer in each form that detects for a mouse up / down and acts upon it; only if that form is the active one ( ie the form caption is Active). Code: [Select]form2.mousetimertimer(sender :tobject); begin   IsMOuseUp:=getkeystate(vk_lbutton) and $8000=0; // detects if the mouse is up   if ((ismmouseup) and (form2.focused)) then   begin     // do something     // testing show hide button     button1.visible:=not button1.visible;   end; end; The above should if I have it correct only toggle the visibilty when form2 is active; However it is toggling the button even when form1 is the active 1. Is there another way to detect which form is the active one? ---------------------------------------------------------------------- howardpc · 2016-09-27 20:31 Try 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 Screen.ActiveForm ---------------------------------------------------------------------- Josh · 2016-09-30 10:46 Hi Howard Thanks for the reply; i will experiment with that. What I did in the meantime was to create global boolean; ie form1_is_active, and set this to true and false in the form.activate and form.deactivate events; this seems to be working. Josh