Link to home
Start Free TrialLog in
Avatar of dvenkat
dvenkat

asked on

how to show scrollbars for MDI child form

I have a MDI application with MDI child screens.

When I open MDI child screens in the App, I donot get vertical and horizantal scroll bars for child forms (making it look ugly, and hide several control in the form).

For example, when you open a doc. in WORD you get vert. & horiz. scrollbars for the document view automatically.

Though this is farily simple one, but I do not know how to do it (and also documentation is unhelpful).

Thanks for your answer,

D.Venkatesan Pillai
Senior Software Engineer
dvenkat@iptcorp.com or (dvenkat68@hotmail.com)
Avatar of clifABB
clifABB

If you are talking about the scroll bars on the parent form, they should appear automatically when needed.

If you are talking about each child forms scroll bars, you have to add them yourself using VScrollBar & HScrollBar.
ASKER CERTIFIED SOLUTION
Avatar of clsmaster
clsmaster

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dvenkat

ASKER

The problem still persists. The scrollbars also go hiding!

The issue is I paint the form at a size greater than the normal display size. (I expect the VB to automatically show a Scrool bar in this case, and evidently it does not).

Your code will not work in this case, because the scroll bar lie at a screen co-ordinate beyond normal display window size.

So please suggest me someother method or correct if I am wrong or misunderstood you.

Thanks

I will assume you are talking about scrollbars you have added to a child form.  In the form resize event of the child form add this code:
Private Sub Form_Resize()

  HScroll1.Move 0, Me.ScaleHeight - HScroll1.Height, Me.ScaleWidth - VScroll1.Width, HScroll1.Height

  VScroll1.Move Me.ScaleWidth - VScroll1.Width, 0, VScroll1.Width, Me.ScaleHeight - HScroll1.Height

  HScroll1.ZOrder
  VScroll1.ZOrder
End Sub

This will keep your scrollbars visible and aligned to the bottom and right edges of the form.
Avatar of dvenkat

ASKER

Thanks "clifABB" and "clsmaster". It works!


Glad to be of service.