Solved

Hide MDI scroll bars

Posted on 2004-09-23
6
467 Views
Last Modified: 2007-12-19
Hi
Is it possible to hide main window's scrollbars?
0
Comment
Question by:vterekh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
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!

 
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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Intraweb download file link ? 1 169
Multiple image collision 13 90
can't find the executable in Simulator 1 113
Graphics32 under Delphi 10.1 Berlin 2 128
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

697 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