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

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



Память: 0.45 MB
Время: 0.022 c
3-1103456917
cherrex
2004-12-19 14:48
2005.01.23
можно ли создать распределенную БД на interbase


1-1105372936
Quiii
2005-01-10 19:02
2005.01.23
kak otkrit star.exe?? =)


1-1105539287
Igor_thief
2005-01-12 17:14
2005.01.23
Добавление события


3-1103556377
TAN_K
2004-12-20 18:26
2005.01.23
DataTimePicker


14-1103697842
syte_ser78
2004-12-22 09:44
2005.01.23
Обращение к Харьковчанам.




   Наверх