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:
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: 194
  • Transparent_form.zip
    12 KB · Views: 197
Last edited:

stevel05

Expert
Licensed User
Longtime User
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 0

Jorge M A

Well-Known Member
Licensed User
B4X:
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

  • test.zip
    11.1 KB · Views: 184
Upvote 0
Top