MDI ScrollIntoView

From: remove undies to reply (trevor_at_input.undies.co.nz)
Date: 12/22/03


Date: Mon, 22 Dec 2003 23:57:41 +1300

Hello,
  How do I go about making an MDI child form automatically scroll into
view?

  If I have a number of MDI children, and one is sitting off to the
right, and there is a scrollbar in the MDI parent form, I would like the
MDI child to change the scroll position on its parent when it is
selected so that it is entirely visible (if possible).

  I have written some code to do this. It works, and is not terribly
complicated, but involves calls to ScrollWindow and SetScrollPos and the
calculations that are needed for both calls. This is in a private method
called ScrollIntoView which I call in the OnActivate event handler with
TForm(Owner).ClientHandle as a parameter. It seems like a hack so I'm
still wondering how to do it with ordinary Delphi form properties or how
to exploit normal Delphi MDI behaviour.

  BTW, I'm using D7, the MDI parent form has some other controls on it,
and the MDI child has a fixed size.

Scout



Relevant Pages

  • Re: Location information of MDI child forms
    ... It seems that Microsoft does not want us to build applications using MDI ... I do not have the problem of restoring an MDI child to its ... WITHOUT causing the scroll bars to appear. ... When the user scrolls the client area I am storing wrong locations, ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Location information of MDI child forms
    ... position of the top most window should be the top offset. ... MDI Children. ... This works fine as long as the user does not scroll ... When the user scrolls the client area I am storing wrong locations, ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Location information of MDI child forms
    ... You dont need the scroll stuff. ... If you scroll the mdi ... position of the top most window should be the top offset. ... When the user scrolls the client area I am storing wrong locations, ...
    (microsoft.public.dotnet.framework.windowsforms)
  • New MDI Window
    ... I've made an MDI parent form which can create a new MDI child form everytime ... MDI parent (which already contain an MDI child), ...
    (microsoft.public.dotnet.languages.csharp)
  • Browser Control in MDI
    ... I am writting a MDI application that uses the IE Browser ... the IE Browser Control. ... I am not able to scroll unless I first press TAB. ...
    (microsoft.public.dotnet.framework.interop)