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

Вниз

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

 
France   (2002-11-14 11:18) [0]

Всем привет! Как убрать скроллбары из MDIForm, когда кусок окна MDIChild находится за пределами клиентской области? Visible=false ставил - не помогло. Помогите, пожалуйста!


 
Игорь Шевченко ©   (2002-11-14 11:51) [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.


 
France   (2002-11-14 11:56) [2]

Спасибо, Игорь!



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

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

Наверх




Память: 0.47 MB
Время: 0.027 c
3-14393
Jackal22
2002-11-15 13:36
2002.12.05
Ув. МАСТЕРА пож. помогите кто может.


14-14819
Карлсон
2002-11-15 20:14
2002.12.05
звездный дождь.


1-14536
Sergey_Suhoy
2002-11-26 17:40
2002.12.05
Ошибка


1-14668
lionkiller
2002-11-25 17:14
2002.12.05
StringGrid


3-14387
Alexandr_kr
2002-11-15 13:29
2002.12.05
Microsoft SQL Server