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

•  Animation Loaders  965

•  DeLiKaTeS Tetris (Тетрис)  5 900

•  TDictionary Custom Sort  7 850

•  Fast Watermark Sources  7 520

•  3D Designer  10 750

•  Sik Screen Capture  8 078

•  Patch Maker  8 279

•  Айболит (remote control)  8 327

•  ListBox Drag & Drop  7 165

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

•  Графические эффекты  8 393

•  Рисование по маске  7 770

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

•  Canvas Drawing  6 739

•  Рисование Луны  6 669

•  Поворот изображения  5 799

•  Рисование стержней  4 744

•  Paint on Shape  3 445

•  Генератор кроссвордов  4 435

•  Головоломка Paletto  3 579

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

•  Пазл Numbrix  2 835

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

•  Игра HIP  2 553

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

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

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

•  Генератор лабиринта  3 127

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

•  HEX View  3 014

 
скрыть

  Форум  

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-2026 "Delphi Sources" by «SiteAnalyzer». Delphi World FAQ

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