Recent

Author Topic: Ap Mdi forms we can change to form but when valid form is active  (Read 168 times)

eldonfsr

  • Hero Member
  • *****
  • Posts: 593
Hi i have MDi Appe i have several form open or windows but when i ask or validate if form is active always sad not active..

if FormEdit.Active then neve goin true this always form... 
  ShowMessage('Can close App form edit is open');
end else begin
  Self.Close;
end
 There is way to validate that i know form is active when we are interactive with it..
if FormEdit <> nil    could only this option to do that...
 

Thaddy

  • Hero Member
  • *****
  • Posts: 19273
  • Glad to be alive.
Re: Ap Mdi forms we can change to form but when valid form is active
« Reply #1 on: May 16, 2026, 06:50:59 am »
Code: Pascal  [Select][+][-]
  1. var
  2.   ActiveChild:TCustomForm;  // in the MDIForm
  3. begin
  4.   ActiveChild := self.ActiveMdiChild; // does what it says
  5. //....
  6. // or something like..
  7.   Caption := ActiveMdiChild.Classname;
If you programmed it correctly there is also feedback because the color of the child's titlebar changes on activation.
There can be only one child active at a time, so maybe you asked the wrong question?
« Last Edit: May 16, 2026, 07:20:43 am by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

 

TinyPortal © 2005-2018