Главная страница
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.025 c
6-1111871698
Raider
2005-03-27 00:14
2005.06.14
Описание ошибок TClientSocket&amp;TServerSocket (ErrorCode)


1-1117346805
ProGamer
2005-05-29 10:06
2005.06.14
Ламерский вопрос по fsUnderLine


11-1084360316
AlexR
2004-05-12 15:11
2005.06.14
ScrollBox и мышь


14-1117049969
Nic87
2005-05-25 23:39
2005.06.14
Worlds3D - присоединяйтесь!


14-1117056082
Fredy314
2005-05-26 01:21
2005.06.14
Типа пришёл я хвалится(а). И Очень мне хочется поздравлений