Delphi beginners

Moderators: netgert
Number of threads: 358
Number of posts: 982

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
MDIChild Posted by Zake on 12 Oct 2004 at 4:30 PM
I'm creating a text editor that using a MDIChild for the edit box.
So I can create many child window from the main window. I also create a program that process an active child window. But when I run the program, every child window that I create is getting process all together.
I want to know how to tell which is the child window that currently active among the other child window, and tell the program to work only for that child window?
Report
Re: MDIChild Posted by zibadian on 12 Oct 2004 at 11:05 PM
: I'm creating a text editor that using a MDIChild for the edit box.
: So I can create many child window from the main window. I also create a program that process an active child window. But when I run the program, every child window that I create is getting process all together.
: I want to know how to tell which is the child window that currently active among the other child window, and tell the program to work only for that child window?
:
THat's stored in the mainform's ActiveMDIChild property.
Report
How? Posted by Zake on 13 Oct 2004 at 4:17 PM
: THat's stored in the mainform's ActiveMDIChild property.
:
I'm sorry.... but can you tell me what is the command to tell the program to process only the Active child window?
Report
Re: How? Posted by zibadian on 13 Oct 2004 at 11:07 PM
: : THat's stored in the mainform's ActiveMDIChild property.
: :
: I'm sorry.... but can you tell me what is the command to tell the program to process only the Active child window?
:
This sample code will save to text in the active child (providing the memo on the active child is called Memo1):
  ActiveMDIChild.Memo1.Lines.SaveToFile('SomeFile.txt');

Report
Sorry.... Posted by Zake on 14 Oct 2004 at 7:41 PM
: This sample code will save to text in the active child (providing the memo on the active child is called Memo1):
:
:   ActiveMDIChild.Memo1.Lines.SaveToFile('SomeFile.txt');
: 

:
I try it, and the program keep saying that Memo1 is unknown, eventhough my active child have Memo1 in it.
Report
Re: Sorry.... Posted by zibadian on 14 Oct 2004 at 9:58 PM
: : This sample code will save to text in the active child (providing the memo on the active child is called Memo1):
: :
: :   ActiveMDIChild.Memo1.Lines.SaveToFile('SomeFile.txt');
: : 

: :
: I try it, and the program keep saying that Memo1 is unknown, eventhough my active child have Memo1 in it.
:
I'm sorry. I completely forgot that you need to type-cast the ActiveMDIChild. Here is the way to type-cast the ActiveMDIChild:
  (ActiveMDIChild as TForm2).Memo1.Lines.SaveToFile('SomeFile.txt');

if the children are of the TForm2 type.
Report
Again... Posted by Zake on 16 Oct 2004 at 3:17 PM
: I'm sorry. I completely forgot that you need to type-cast the ActiveMDIChild. Here is the way to type-cast the ActiveMDIChild:
:
:   (ActiveMDIChild as TForm2).Memo1.Lines.SaveToFile('SomeFile.txt');
: 

: if the children are of the TForm2 type.
:

I'm sorry to trouble you again....
But I tried it too, and the result said that "Operator not applicableto this opperand type". What went wrong?
Report
Re: Again... Posted by zibadian on 16 Oct 2004 at 5:35 PM
This message was edited by zibadian at 2004-10-16 17:35:36

: : I'm sorry. I completely forgot that you need to type-cast the ActiveMDIChild. Here is the way to type-cast the ActiveMDIChild:
: :
: :   (ActiveMDIChild as TForm2).Memo1.Lines.SaveToFile('SomeFile.txt');
: : 

: : if the children are of the TForm2 type.
: :
:
: I'm sorry to trouble you again....
: But I tried it too, and the result said that "Operator not applicableto this opperand type". What went wrong?
:
You must have made a mistake in your code, because I just tested the code and it worked perfectly. If you post your coded I can see what's wrong.

Report
My Mistake Posted by Zake on 20 Oct 2004 at 4:52 PM
: You must have made a mistake in your code, because I just tested the code and it worked perfectly. If you post your coded I can see what's wrong.
:
:
You're right, my mistake. I forgot to put the T in front of the Form2.
Thank you very much for your help.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.