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

Вниз

Убрать ScrollBar MDI формы   Найти похожие ветки 

 
Vest   (2003-09-01 19:17) [0]

Столкнулся с такой проблемой: как запретить показывать скрллбар материнской форме, когда ее "дети" заходят за рабочую область?


 
ggsoft ©   (2003-09-01 19:20) [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.


 
Song ©   (2003-09-01 20:28) [2]

Отвечал Игорь Шевченко или я.



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

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

Наверх




Память: 0.47 MB
Время: 0.033 c
1-48497
Olegka
2003-09-02 18:38
2003.09.15
Последние 2 вопроса по word и excel


4-48829
jenya_d1
2003-07-15 08:37
2003.09.15
Выбор имени сервера в сети


4-48838
miwa
2003-07-15 21:37
2003.09.15
При вызове ShellExecuteEx получаю 5-ю ошибку:


6-48673
Maxim Pshevlotsky
2003-07-11 06:54
2003.09.15
TIDFTP.LIST - Отличия присылаемых строк Windows и Linux


1-48611
webPauk
2003-09-03 13:11
2003.09.15
ScreenSaver