Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2007.02.11;
Скачать: CL | DM;

Вниз

приклеить дополнительную форму   Найти похожие ветки 

 
tst   (2006-09-26 14:40) [0]

Мужики, подскажите что перехватываем для отлова перемещения окна главной формы, что бы можно было бы спозиционировать рядышком где-нибудь дополнительную формочку?


 
Игорь Шевченко ©   (2006-09-26 14:50) [1]

WM_MOVE


 
tst   (2006-09-26 15:12) [2]

спасибо Игорёк!

Примерно так:

type
 TfrmMain = class(TForm)
 private
   procedure OnMove(var Msg: TWMMove); message WM_MOVE;
end;

...

procedure TfrmMain.OnMove(var Msg: TWMMove);
begin
 inherited;
 ...
end;

...


 
Игорь Шевченко ©   (2006-09-26 15:54) [3]


> Примерно так:


unit main;

interface

uses
 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
 StdCtrls;

type
 TfMain = class(TForm)
   cbSyncMoving: TCheckBox;
 private
   procedure WMMove (var Message: TWmMove);
     message WM_MOVE;
   procedure WMMoving (var Message: TMessage);
     message WM_MOVING;
   procedure UpdateChildPos;
   procedure UpdateChildRect (const Rect: TRect);
 end;

var
 fMain: TfMain;

implementation
uses
 Child;

{$R *.DFM}

{ TfMain }

procedure TfMain.UpdateChildPos;
begin
 if Assigned(fChild) then begin
   fChild.Left := Left;
   fChild.Top := Top + Height;
 end;
end;

procedure TfMain.UpdateChildRect(const Rect: TRect);
begin
 if Assigned(fChild) then begin
   fChild.Left := Rect.Left;
   fChild.Top := Rect.Top + Height;
 end;
end;

procedure TfMain.WMMove(var Message: TWmMove);
begin
 inherited;
 UpdateChildPos;
end;

procedure TfMain.WMMoving(var Message: TMessage);
begin
 inherited;
 if cbSyncMoving.Checked then
   UpdateChildRect (PRect(Message.LParam)^);
end;

end.



Страницы: 1 вся ветка

Текущий архив: 2007.02.11;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.031 c
2-1169656059
NightRain
2007-01-24 19:27
2007.02.11
А можно в delphi компоненты на форме прописать в массив?


15-1169180260
Slider007
2007-01-19 07:17
2007.02.11
С днем рождения ! 19 января


3-1163750618
AlexSt
2006-11-17 11:03
2007.02.11
Отслеживание изменений другим пользователем


3-1163962355
Firefly
2006-11-19 21:52
2007.02.11
Поле autoincrement в Oracle


1-1166275254
antonioxxx
2006-12-16 16:20
2007.02.11
Получение координаты в TChart