Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.026 c
1-1166611677
DinoRay
2006-12-20 13:47
2007.02.11
TreeView Drag&Drop непонятки


2-1169571641
*Ray*
2007-01-23 20:00
2007.02.11
Модификация данных


15-1169228956
vrem
2007-01-19 20:49
2007.02.11
Есть ли у Вас проблемы с головой?


3-1164137692
DillerXX
2006-11-21 22:34
2007.02.11
Помогите составить SQL запрос...


9-1143546968
Yegorchic
2006-03-28 15:56
2007.02.11
Очистить FreeForm




   Наверх