B4J Question Close Transparent Form Problem

behnam_tr

Active Member
Licensed User
Longtime User
hi
i have a problem with closing transparent form and myown titlebar with pane
when i open "frm2" > two or many time only close form that opened first and i cant close others

i'm using this class for titlebar : https://www.b4x.com/android/forum/threads/replacement-titlebar.84586/

example attached.....


B4X: Copy
sub mainform start()
mainform.show

sleep(1000)
form2.show  'its can close'

sleep(1000)
form2.show  'i can not close this'

end sub

this problem only when i use titlebar
thats ok in decorated or ..... style
 

Attachments

  • testttt.png
    testttt.png
    38.6 KB · Views: 635
  • Transparent_form.zip
    Transparent_form.zip
    12 KB · Views: 528
Last edited:
Solution
You are storing frm2 in a global variable in a Code module.

When the second instance is initialized, the first is overwritten and no longer available. To get this to work, you would need to put the code in a class module and manage them separately.
You are storing frm2 in a global variable in a Code module.

When the second instance is initialized, the first is overwritten and no longer available. To get this to work, you would need to put the code in a class module and manage them separately.
 
Upvote 1
Solution
B4X: Copy
sub mainform start()
mainform.show

sleep(1000)
form2.show 'its can close'

sleep(1000)
form2.show 'i can not close this'

end sub
This code is no longer in your project.
Anyway, you can convert your "form2" into a Class and instantiate a new form in the Click event.
Your modified project attached.

EDIT: I'Sorry @stevel05 ! I was writing and don't see your previous answer.
 

Attachments

Upvote 0
Back
Top