Recent

Author Topic: [SOLVED] Using A 2nd Form  (Read 284 times)

pixelink

  • Hero Member
  • *****
  • Posts: 938
    • Pixelink Media
[SOLVED] Using A 2nd Form
« on: April 15, 2019, 12:27:55 pm »
In VB.NET, when you showed a form Modal, it kind of stops the main form from running anymore code until you close the 2nd Modal form.

In LAZ this is different.
After showing a 2nd Modal form and use the syntax "Close;", the form kind of like hides but is not free.
I get that closing and freeing is two different things

But, I need to execute code on the main form AFTER the 2nd form is closed.
But, the main form code doesn't run my code after the "Form2.ShowModal();" statement

What do I need to do about this.

Example:
Code: Pascal  [Select]
  1. code1... code1...
  2. Form2.ShowModal();
  3. code2... code 2....
  4.  

My code after showing modal form doesn't execute.



« Last Edit: April 15, 2019, 02:32:04 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!


Pixelink Media •  Pixelink Forum
LAZ 2.02 • Win10 • 16G RAM • Nivida GForce RTX 2060

Handoko

  • Hero Member
  • *****
  • Posts: 3085
  • My goal: build my own game engine using Lazarus
Re: Using A 2nd Form
« Reply #1 on: April 15, 2019, 12:34:30 pm »
It sounds weird. Can you please provide a compile-able simple demo that showing the issue so we can inspect and test it.

furious programming

  • Sr. Member
  • ****
  • Posts: 349
  • I click a little.
Re: Using A 2nd Form
« Reply #2 on: April 15, 2019, 12:35:17 pm »
In VB.NET, when you showed a form Modal, it kind of stops the main form from running anymore code until you close the 2nd Modal form.

In Free Pascal it works the same. But provide an example to test in local environment.
Lazarus 2.0.2 with FPC 3.0.4, Windows XP (all 32-bit)

pixelink

  • Hero Member
  • *****
  • Posts: 938
    • Pixelink Media
Re: Using A 2nd Form
« Reply #3 on: April 15, 2019, 02:31:39 pm »
Never, mind, it does work. I had a problem with another piece of code.

Thanks
Can't Type - Forgetful - Had Stroke = Forgive this old man!


Pixelink Media •  Pixelink Forum
LAZ 2.02 • Win10 • 16G RAM • Nivida GForce RTX 2060