Недавно добавленные исходники

•  DeLiKaTeS Tetris (Тетрис)  4 451

•  TDictionary Custom Sort  6 487

•  Fast Watermark Sources  6 283

•  3D Designer  9 226

•  Sik Screen Capture  6 616

•  Patch Maker  6 996

•  Айболит (remote control)  7 001

•  ListBox Drag & Drop  5 870

•  Доска для игры Реверси  97 073

•  Графические эффекты  7 201

•  Рисование по маске  6 503

•  Перетаскивание изображений  5 369

•  Canvas Drawing  5 743

•  Рисование Луны  5 455

•  Поворот изображения  4 983

•  Рисование стержней  3 536

•  Paint on Shape  2 805

•  Генератор кроссвордов  3 672

•  Головоломка Paletto  2 959

•  Теорема Монжа об окружностях  3 763

•  Пазл Numbrix  2 482

•  Заборы и коммивояжеры  3 166

•  Игра HIP  2 134

•  Игра Go (Го)  2 068

•  Симулятор лифта  2 440

•  Программа укладки плитки  2 114

•  Генератор лабиринта  2 585

•  Проверка числового ввода  2 264

•  HEX View  2 593

•  Физический маятник  2 202

 
скрыть

  Форум  

Delphi FAQ - Часто задаваемые вопросы

| Базы данных | Графика и Игры | Интернет и Сети | Компоненты и Классы | Мультимедиа |
| ОС и Железо | Программа и Интерфейс | Рабочий стол | Синтаксис | Технологии | Файловая система |



Delphi Sources

Прочитать данные из другого дочернего окна



Оформил: DeeCo

type
   TMDIChildForm = class(TForm)
     Edit1: TEdit;
   private
     { Private declarations }
     procedure ReadDataFromOtherMDIChildForm;
   end;

 var
   MDIChildForm: TMDIChildForm;

 implementation

 {$R *.DFM}

 uses
   MainForm;
   // Property FormStyle of this form is fsMDIForm 

procedure TMDIChildForm.ReadDataFromOtherMDIChildForm;
 var
   i: Integer;
   DataFromOtherForm: string;
 begin
   // Suppose you have created three different MDIChild forms of the same type, 
  // each with the following caption: "aaa", "bbb", "ccc". 
  // You are currently on form with caption "aaa" and want to read data 
  // contained on form with caption "ccc". 
  // You can find here the code, you have to use the "as" clause and 
  // properties MDIChildCount and MDIChildren: 

  // First you have to find where the form "ccc" is in memory; 
  for i := 0 to MDIForm.MDIChildCount - 1 do
   begin
     if (Pos('ccc', MDIForm.MDIChildren[i].Caption)  0) then
       Break;
   end;
   // Check to see if the form is the last on MDIChildren array and 
  // correct I variable 
  if (i = MDIChildCount) then Dec(i);
   // I variable contains the index of the form with caption 'ccc' 

  if (Pos('ccc', MDIForm.MDIChildren[i].Caption)  0) then
   begin
     // If the form with caption 'ccc' exists then you access data and show it 
    // The following line of code is very interesting, look at the "as" clause, 
    // if you have different types of MDIChild forms, you simply change 
    // the type of form after the "as" clause 
    // The data you want is contained on Edit1.Text 
    with (MDIForm.MDIChildren[I] as TMDIChildForm).Edit1 do
       DataFromOtherForm := Text;
     ShowMessage(DataFromOtherForm);
   end;
 end;




Похожие по теме исходники

Посторонние окна WinAPI




Copyright © 2004-2025 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

Группа ВКонтакте