?
Solved

Hide MDI scroll bars

Posted on 2004-09-23
6
Medium Priority
?
479 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Accepted Solution

by:
Ferruccio Accalai earned 500 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 34

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

850 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