Solved

Hide MDI scroll bars

Posted on 2004-09-23
6
462 Views
Last Modified: 2007-12-19
Hi
Is it possible to hide main window's scrollbars?
0
Comment
Question by:vterekh
6 Comments
 
LVL 12

Expert Comment

by:esoftbg
ID: 12131097
 FormMain.HorzScrollBar.Visible := False;
  FormMain.VertScrollBar.Visible := False;
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12131104
It would be done by ObjectInspector at DesignTime ....
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12131131
Sorry, it does not work. I tested it without to try to move a ChildForm out of MainForm's size
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 22

Accepted Solution

by:
Ferruccio Accalai earned 125 total points
ID: 12131360
use this method (add it to the MDI mainform)

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: Begin
        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;
  End;
  Result := CallWindowProc( f, wnd, msg, wparam, lparam );
End;

procedure TMainForm.FormCreate(Sender: TObject);
begin
If ClientHandle <> 0 Then Begin
    If GetWindowLong( ClientHandle, GWL_USERDATA ) <> 0 Then
      Exit;
    SetWindowLong( ClientHandle, GWL_USERDATA,
                   SetWindowLong( ClientHandle, GWL_WNDPROC,
                                  integer( @ClientWindowProc)));
  end;

end;

F68 ;-)
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 12140100
or ovverride CreateWnd;

procedure TMyForm.CreateWnd;
var
 ClientCreateStruct: TClientCreateStruct;
begin
 inherited CreateWnd;
 if NewStyleControls then
   if BorderStyle <> bsDialog then
     SendMessage(Handle, WM_SETICON, 1, GetIconHandle) else
     SendMessage(Handle, WM_SETICON, 1, 0);
 if not (csDesigning in ComponentState) then
   case FormStyle of
     fsMDIForm:
       begin
         with ClientCreateStruct do
         begin
           idFirstChild := $FF00;
           hWindowMenu := 0;
           if FWindowMenu <> nil then hWindowMenu := FWindowMenu.Handle;
         end;
         FClientHandle := Windows.CreateWindowEx(WS_EX_CLIENTEDGE, 'MDICLIENT',
           nil, WS_CHILD or WS_VISIBLE or WS_GROUP or WS_TABSTOP or
           WS_CLIPCHILDREN or WS_CLIPSIBLINGS or
           MDIS_ALLCHILDSTYLES, 0, 0, ClientWidth, ClientHeight, Handle, 0,
           HInstance, @ClientCreateStruct);
         FClientInstance := MakeObjectInstance(ClientWndProc);
         FDefClientProc := Pointer(GetWindowLong(FClientHandle, GWL_WNDPROC));
         SetWindowLong(FClientHandle, GWL_WNDPROC, Longint(FClientInstance));
       end;
     fsStayOnTop:
       SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or
         SWP_NOSIZE or SWP_NOACTIVATE);
   end;
end;
0
 
LVL 33

Expert Comment

by:Slick812
ID: 12140108
you might try AutoScroll set to false

procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.AutoScroll := False;
rnd;
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now