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

Вниз

MDI scroll   Найти похожие ветки 

 
EvgeniyR ©   (2004-02-19 16:13) [0]

Есть MDI приложение, если переместить дочернее окно за пределы главной формы, появляются полосы прокрутки, как от них избавится? AutoScroll не помогает. Заранее спасибо.


 
Игорь Шевченко ©   (2004-02-20 15:53) [1]

{ Избавление от ScrollBar"ов в MDI-форме. (С) Peter Below (TeamB) }
{ Не надо VCL переписывать :-) }

unit MainForm;

interface

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

type
TfMain = class(TForm)
MainMenu1: TMainMenu;
Newchild1: TMenuItem;
Newchild2: TMenuItem;
procedure Newchild2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
fMain: TfMain;

implementation

uses ChildForm;

{$R *.DFM}

procedure TfMain.Newchild2Click(Sender: TObject);
begin
with TfChild.Create(Application) do
Show();
end;

function ClientWindowProc( wnd: HWND; msg: Cardinal; wparam, lparam: Integer ): Integer; stdcall;
var
f: Pointer;
begin
f := Pointer( GetWindowLong( wnd, GWL_USERDATA ));
case msg of
WM_NCCALCSIZE:
if ( GetWindowLong( wnd, GWL_STYLE ) and
(WS_HSCROLL or WS_VSCROLL)) <> 0 then
SetWindowLong( wnd, GWL_STYLE, GetWindowLong( wnd, GWL_STYLE )
and not (WS_HSCROLL or WS_VSCROLL));
end;
Result := CallWindowProc( f, wnd, msg, wparam, lparam );
end;

procedure TfMain.FormCreate(Sender: TObject);
begin
if ClientHandle <> 0 then begin
if GetWindowLong( ClientHandle, GWL_USERDATA ) <> 0 then
Exit; {cannot subclass client window, userdata already in use}
SetWindowLong(ClientHandle, GWL_USERDATA, SetWindowLong( ClientHandle,
GWL_WNDPROC, integer( @ClientWindowProc)));
end;

end;

end.



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

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

Наверх




Память: 0.47 MB
Время: 0.016 c
3-5998
jeka_t
2004-02-04 18:30
2004.03.03
Как отфильтровать компонент ADOTable по заданному фильтру.


14-6202
Calm
2004-02-11 09:47
2004.03.03
Готовимся к переходу на Аду?


6-6175
Perf
2003-12-26 09:07
2004.03.03
Определение IP и поиск компов в локалке


14-6242
Dimman
2004-02-10 19:04
2004.03.03
бот для чата


1-6037
Кен
2004-02-17 07:06
2004.03.03
Как копировать код из дебаггера ?