Recent

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

pixelink

  • Sr. Member
  • ****
  • Posts: 488
    • 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 »
Pixelink Media •  My LAZ Forum Page
Lazarus 2.0 w/FPC-3.0.4 • Windows 7 • 10G RAM • NIV-GForce GT 640 Graphics Card
Pascal, VB6, VBA, VB.NET • sql, php, html/css, javascript

Handoko

  • Hero Member
  • *****
  • Posts: 2983
  • 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: 262
  • 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.0 with FPC 3.0.4, Windows XP (all 32-bit)

pixelink

  • Sr. Member
  • ****
  • Posts: 488
    • 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
Pixelink Media •  My LAZ Forum Page
Lazarus 2.0 w/FPC-3.0.4 • Windows 7 • 10G RAM • NIV-GForce GT 640 Graphics Card
Pascal, VB6, VBA, VB.NET • sql, php, html/css, javascript