Recent

Author Topic: Child Form to Parent Form  (Read 11376 times)

anna

  • Sr. Member
  • ****
  • Posts: 426
Child Form to Parent Form
« on: July 15, 2010, 03:37:23 pm »
Suppose project has 2 forms.
How can I understand, what form is parent (main form)?
How to convert child form to parent and vice versa?
WinXP SP3 Pro Russian 32-bit (5.1.2600)

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1933
Re: Child Form to Parent Form
« Reply #1 on: July 15, 2010, 03:54:29 pm »
Suppose project has 2 forms.
How can I understand, what form is parent (main form)?
How to convert child form to parent and vice versa?

What do you want to achieve?
http://catb.org/esr/faqs/smart-questions.html#goal

anna

  • Sr. Member
  • ****
  • Posts: 426
Re: Child Form to Parent Form
« Reply #2 on: July 15, 2010, 04:06:07 pm »
You 99% will not be able to reproduce my problem.
I have project with 2 forms which manipulate another programmes. If i set mainform's FormStyle property to fsSystemStayOnTop all is OK. But if childform's FormStyle property to fsSystemStayOnTop, sometimes this childform disappears.
Generally I need my ChildForm to be on top of Windows Z-Order.
WinXP SP3 Pro Russian 32-bit (5.1.2600)

anna

  • Sr. Member
  • ****
  • Posts: 426
Re: Child Form to Parent Form
« Reply #3 on: July 15, 2010, 04:36:27 pm »
How does Windows detect mainform of multiform application?
Why does fsSystemStayOnTop work only with mainform?
What code is required to make some form (not first appeared) main? Or mayby better how to destroy parental dependences between forms?
« Last Edit: July 15, 2010, 04:38:37 pm by anna »
WinXP SP3 Pro Russian 32-bit (5.1.2600)

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1933
Re: Child Form to Parent Form
« Reply #4 on: July 15, 2010, 04:45:50 pm »
What you describe is a bug. Please test with the latest Lazarus Snapshot:
ftp://ftp.freepascal.org/pub/lazarus/snapshots

If it still has the problem, see if it's already reported in the bugtracker.
If not, create a bug report with a compilable project showing the bug.
« Last Edit: July 15, 2010, 04:49:54 pm by theo »

anna

  • Sr. Member
  • ****
  • Posts: 426
Re: Child Form to Parent Form
« Reply #5 on: July 15, 2010, 05:00:42 pm »
What you describe is a bug. Please test with the latest Lazarus Snapshot:
ftp://ftp.freepascal.org/pub/lazarus/snapshots

If it still has the problem, see if it's already reported in the bugtracker.
If not, create a bug report with a compilable project showing the bug.


As I said, it's very difficult to reproduce problem. I deal with over 50 programmes at same time. If there is few programmes, my child form stay on top always.
WinXP SP3 Pro Russian 32-bit (5.1.2600)

anna

  • Sr. Member
  • ****
  • Posts: 426
Re: Child Form to Parent Form
« Reply #6 on: July 15, 2010, 05:02:59 pm »
How to work with Application.MainForm property?
Next code does not work:
Code: [Select]
Application.MainForm:=Form2;
WinXP SP3 Pro Russian 32-bit (5.1.2600)

Troodon

  • Sr. Member
  • ****
  • Posts: 484
Re: Child Form to Parent Form
« Reply #7 on: July 15, 2010, 05:16:18 pm »
Lazarus/FPC on Linux

 

TinyPortal © 2005-2018