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

Вниз

Липкие окошки   Найти похожие ветки 

 
Oddin ©   (2005-01-11 01:56) [0]

Как сделать чтобы форма клеилась "примагничивалась" к краям экрана???


 
Unleashed   (2005-01-11 02:03) [1]

Можно обработать wm_move , а в нём сравнивать координаты углов формы с экраном (screen.width,screen.height). пример:
...
with form1 do begin
if left <= 15 then form1.left:=0;
if screen.width-(left+width) >= 15 then .left:=
screen.width- width;
...
и т.д.


 
GanibalLector ©   (2005-01-11 02:05) [2]


...
type
TForm1 = class(TForm)
private
  { Private declarations }
  procedure WMEXITSIZEMOVE(var Msg: TMessage); message WM_EXITSIZEMOVE;
public
  { Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.WMEXITSIZEMOVE(var Msg: TMessage);
var Screen: TRect;
begin
inherited;
SystemParametersInfo(SPI_GETWORKAREA, 0, @Screen, 0);
if Left < Screen.Left then Left := Screen.Left;
if Top  < Screen.Top  then Top  := Screen.Top;
if (Left + Width) > Screen.Right  then Left := (Screen.Right - Width);
if (Top + Height) > Screen.Bottom then Top  := (Screen.Bottom - Height);
Msg.Result := 0;
end;


 
Oddin ©   (2005-01-11 02:21) [3]

Спасибо. Еще один вопрос. Как не дать форме выходить за края экрана.


 
Поручик ©   (2005-01-11 02:56) [4]

Проверять ее left, top, left+width и top+height чтобы не выходили за края
правый край - screen.width
нижний край - screen.height;
а остальные нули
Удачи



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

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

Наверх




Память: 0.47 MB
Время: 0.027 c
3-1103554933
alex145
2004-12-20 18:02
2005.01.23
FoxPro


3-1102955048
Dmitrich
2004-12-13 19:24
2005.01.23
Большой текст


3-1103282169
}|{yk
2004-12-17 14:16
2005.01.23
Что может означать данная ошибка?


1-1105385578
Anonimus
2005-01-10 22:32
2005.01.23
Вопрос по TListView


1-1105368371
ArchValentin
2005-01-10 17:46
2005.01.23
Создание хэлпов