Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Hide MDI scroll bars

Posted on 2004-09-23
6
Medium Priority
?
476 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

670 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