behnam_tr Active Member Licensed User Longtime User Aug 4, 2020 #1 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 38.6 KB · Views: 635 Transparent_form.zip Transparent_form.zip 12 KB · Views: 528 Last edited: Sep 3, 2020
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
Solution stevel05 Sep 3, 2020 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.
stevel05 Expert Licensed User Longtime User Sep 3, 2020 #2 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
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.
Jorge M A Well-Known Member Licensed User Longtime User Sep 3, 2020 #3 behnam_tr said: 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 Click to expand... 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 test.zip 11.1 KB · Views: 532 Upvote 0
behnam_tr said: 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 Click to expand... 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.
stevel05 Expert Licensed User Longtime User Sep 3, 2020 #4 Jorge M A said: I was writing and don't see your previous answer. Click to expand... Overlapped, If I had created an example, you would have posted first Upvote 0
Jorge M A said: I was writing and don't see your previous answer. Click to expand... Overlapped, If I had created an example, you would have posted first