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

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



Память: 0.45 MB
Время: 0.014 c
14-48711
Rouse_
2003-08-28 03:34
2003.09.15
Ох уж эти модели...


4-48826
Noname_
2003-07-15 12:20
2003.09.15
Заменить заставку при загрузке Windows XP


1-48536
Dream
2003-09-02 11:18
2003.09.15
Как проверить есть ли в списке listbox текст указаный в edit ?


4-48823
Orion2
2003-07-15 12:40
2003.09.15
Переопределение оконной процедуры нескольким TEdit


14-48697
Всеволод Соловьёв
2003-08-24 00:21
2003.09.15
---|Ветка была без названия|---




   Наверх