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

•  DeLiKaTeS Tetris (Тетрис)  128

•  TDictionary Custom Sort  3 312

•  Fast Watermark Sources  3 062

•  3D Designer  4 818

•  Sik Screen Capture  3 314

•  Patch Maker  3 529

•  Айболит (remote control)  3 630

•  ListBox Drag & Drop  2 993

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

•  Графические эффекты  3 922

•  Рисование по маске  3 227

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

•  Canvas Drawing  2 732

•  Рисование Луны  2 556

•  Поворот изображения  2 163

•  Рисование стержней  2 160

•  Paint on Shape  1 564

•  Генератор кроссвордов  2 225

•  Головоломка Paletto  1 764

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

•  Пазл Numbrix  1 682

•  Заборы и коммивояжеры  2 052

•  Игра HIP  1 278

•  Игра Go (Го)  1 224

•  Симулятор лифта  1 471

•  Программа укладки плитки  1 214

•  Генератор лабиринта  1 542

•  Проверка числового ввода  1 351

•  HEX View  1 489

•  Физический маятник  1 355

 
скрыть


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-2024 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

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