Recent

Author Topic: Handle event OnClick for hidden objects  (Read 196 times)

las

  • New Member
  • *
  • Posts: 26
Handle event OnClick for hidden objects
« on: June 05, 2019, 08:42:13 pm »
Hi!
Placed on the form panel jPanel1. On the panel jPanel1 put jPanel2. On both panels I assign the OnClick event. I programmatically hide jPanel2 (jPanel2.visible: = false)
jPanel2 disappears from the screen, but the onPlick event on jPanel1 does not work where the hidden jPanel2 is located.

Why is that?

jmpessoa

  • Hero Member
  • *****
  • Posts: 1455
Re: Handle event OnClick for hidden objects
« Reply #1 on: June 06, 2019, 12:14:35 am »

You can try:

Code: Pascal  [Select]
  1.  jPanel2.visible: = false   // <<--- your code
  2.  jPanel1.BringToFront();  // <<---  NEW code
  3.  
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard