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

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



Память: 0.45 MB
Время: 0.023 c
9-1106580715
Trof
2005-01-24 18:31
2005.06.14
Ландшафт в 3dsmax.


1-1117038148
Тёма_бест
2005-05-25 20:22
2005.06.14
TMainMenu заглючил


3-1115289576
Борис72Ф
2005-05-05 14:39
2005.06.14
кирилица в IB


14-1116786734
Gero
2005-05-22 22:32
2005.06.14
Явное обострение


3-1115900109
pavel_guzhanov
2005-05-12 16:15
2005.06.14
вопрос про DBGrid




   Наверх