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

Вниз

Как создать форму, похожую на ICQ   Найти похожие ветки 

 
Mixan ©   (2002-02-02 19:43) [2]

Насчет прилипала:

unit Unit1;

interface

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

type
TfrMain = class(TForm)
edStickAt: TEdit;
Label1: TLabel;
chkTop: TCheckBox;
chkBottom: TCheckBox;
chkRight: TCheckBox;
chkLeft: TCheckBox;
procedure edStickAtKeyPress(Sender: TObject; var Key: Char);
private
procedure WMWINDOWPOSCHANGING (Var Msg: TWMWINDOWPOSCHANGING); message WM_WINDOWPOSCHANGING;
public
{ Public declarations }
end;

var
frMain: TfrMain;

implementation
{$R *.DFM}


procedure TfrMain.WMWINDOWPOSCHANGING (var Msg: TWMWINDOWPOSCHANGING);
const
Docked: Boolean = FALSE;
var
rWorkArea: TRect;
StickAt : Word;
begin
StickAt := StrToInt(edStickAt.Text);

SystemParametersInfo (SPI_GETWORKAREA, 0, @rWorkArea, 0);

with Msg.WindowPos^ do begin
if chkLeft.Checked then
if x <= rWorkArea.Left + StickAt then begin
x := rWorkArea.Left;
Docked := TRUE;
end;

if chkRight.Checked then
if x + cx >= rWorkArea.Right - StickAt then begin
x := rWorkArea.Right - cx;
Docked := TRUE;
end;

if chkTop.Checked then
if y <= rWorkArea.Top + StickAt then begin
y := rWorkArea.Top;
Docked := TRUE;
end;

if chkBottom.Checked then
if y + cy >= rWorkArea.Bottom - StickAt then begin
y := rWorkArea.Bottom - cy;
Docked := TRUE;
end;

if Docked then begin
with rWorkArea do begin
// no moving out of the screen
if x < Left then x := Left;
if x + cx > Right then x := Right - cx;
if y < Top then y := Top;
if y + cy > Bottom then y := Bottom - cy;
end; {with rWorkArea}
end; {if Docked}
end; {with Msg.WindowPos^}

inherited;
end;

procedure TfrMain.edStickAtKeyPress(Sender: TObject; var Key: Char);
begin
if not (key in ["0".."9"]) then Abort;
end;

end.



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

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

Наверх




Память: 0.46 MB
Время: 0.377 c
3-59
Vks
2002-03-07 10:46
2002.04.01
Paradox при некорректном завершении теряет данные


7-323
B1ADE
2001-12-25 00:46
2002.04.01
КАК Включить и ВЫКЛЮЧИТЬ КЛАВУ !!!


1-116
Sergy
2002-03-21 16:36
2002.04.01
Длина переменной типа string


1-239
Zool
2002-03-18 19:22
2002.04.01
GetFileTime и SetFileTime


3-78
Draculenok
2002-03-01 15:15
2002.04.01
Как сгруппировать в Excele&