MDIChild

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?

Comments

  • : 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.
  • : 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?
  • : : 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):
    [code]
    ActiveMDIChild.Memo1.Lines.SaveToFile('SomeFile.txt');
    [/code]
  • : This sample code will save to text in the active child (providing the memo on the active child is called Memo1):
    : [code]
    : ActiveMDIChild.Memo1.Lines.SaveToFile('SomeFile.txt');
    : [/code]
    :
    I try it, and the program keep saying that Memo1 is unknown, eventhough my active child have Memo1 in it.
  • : : This sample code will save to text in the active child (providing the memo on the active child is called Memo1):
    : : [code]
    : : ActiveMDIChild.Memo1.Lines.SaveToFile('SomeFile.txt');
    : : [/code]
    : :
    : 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:
    [code]
    (ActiveMDIChild as TForm2).Memo1.Lines.SaveToFile('SomeFile.txt');
    [/code]
    if the children are of the TForm2 type.
  • : I'm sorry. I completely forgot that you need to type-cast the ActiveMDIChild. Here is the way to type-cast the ActiveMDIChild:
    : [code]
    : (ActiveMDIChild as TForm2).Memo1.Lines.SaveToFile('SomeFile.txt');
    : [/code]
    : 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?
  • [b][red]This message was edited by zibadian at 2004-10-16 17:35:36[/red][/b][hr]
    : : I'm sorry. I completely forgot that you need to type-cast the ActiveMDIChild. Here is the way to type-cast the ActiveMDIChild:
    : : [code]
    : : (ActiveMDIChild as TForm2).Memo1.Lines.SaveToFile('SomeFile.txt');
    : : [/code]
    : : 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.

  • : 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.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories