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

Вниз

Растягивание формы   Найти похожие ветки 

 
Merl   (2005-04-22 22:31) [0]

Как можно растягивать форму за края, если ее стиль утсановлен как bsNone? То есть форма без заголовка.


 
Ученик   (2005-04-22 22:51) [1]

Фрагмент :-)

procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST;

procedure TForm1.WMNCHitTest(var Message: TWMNCHitTest);
begin
 if Message.XPos < Left + 3 then
   Message.Result := HTLEFT
 else
   inherited
end;


 
easy ©   (2005-04-23 00:56) [2]

unit Unit1;
interface
uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs;
type
 TForm1 = class(TForm)
   procedure FormCreate(Sender: TObject);
 private
   { Private declarations }
   procedure WMNCHitTest(var msg: TWMNCHitTest); message wm_NCHitTest;
 public
   { Public declarations }
 end;
var
 Form1: TForm1;
implementation
{$R *.dfm}
{ TForm1 }
procedure TForm1.WMNCHitTest(var msg: TWMNCHitTest);
const
 Tolerance = 5;
var
 P: TPoint;
 OverRight: Boolean;
 OverLeft: Boolean;
 OverTop: Boolean;
 OverBottom: Boolean;
begin
 with Msg do
 begin
   P := ScreenToClient(Point(XPos, YPos));
   OverRight := Abs(P.x - Width) < Tolerance;
   OverLeft := Abs(P.x) < Tolerance;
   OverTop := Abs(P.y) < Tolerance;
   OverBottom := Abs(P.y - Height) < Tolerance;
 if OverRight then
   begin
     if OverTop then
       Result := HTTOPRIGHT
     else if OverBottom then
       Result := HTBOTTOMRIGHT
     else
       Result := HTRIGHT;
   end
   else if OverLeft then
   begin
     if OverTop then
       Result := HTTOPLEFT
     else if OverBottom then
       Result := HTBOTTOMLEFT
     else
       Result := HTLEFT;
   end
   else if OverTop then
     Result := HTTOP
   else if OverBottom then
     Result := HTBOTTOM
   else
     Result := HTCAPTION;
 end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
  borderstyle:=bsNone;
end;
end.



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

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

Наверх




Память: 0.47 MB
Время: 0.047 c
1-1117290274
Genie™
2005-05-28 18:24
2005.06.14
Как бороться с таким идиотизмом???


3-1115474909
Karburator
2005-05-07 18:08
2005.06.14
виртуальные таблицы - ? или другой способ...


1-1117117776
Димастый
2005-05-26 18:29
2005.06.14
Invalidate и Refresh


1-1117600097
ORMADA
2005-06-01 08:28
2005.06.14
Drag n Drop + Ctrl


1-1117167035
Andurbay
2005-05-27 08:10
2005.06.14
Перезапуск формы