Вниз
Скачать: 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.02 c
1-1105449990
Qtintf
2005-01-11 16:26
2005.01.23
Qtintf.dll


1-1105388433
m0l0doy
2005-01-10 23:20
2005.01.23
чужое окно


6-1099288139
RomCom
2004-11-01 08:48
2005.01.23
Socket -> Proxy и адреса удаленных серверов


3-1103280544
denis24
2004-12-17 13:49
2005.01.23
fieldbyname( f1 ).isnull


14-1104751852
vecna
2005-01-03 14:30
2005.01.23
Кто какие подарки получил на НГ?! =)




   Наверх