CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Scrolling Forms

  1. #1
    Join Date
    Jul 1999
    Location
    Mumbai - India
    Posts
    12

    Scrolling Forms

    Hi Everybody,

    I am working on a project using MDI. In MDI it is necessary to have child forms (MDI Clients) with scrollbars so that any resizing done by the user does not make some portions of the form inaccessible.

    I tried to find out some way out but could not find any property which would allow me to put scrollbars on the form. Only MDIFrame supports Scrollbars property, but what about MDIChildren? I worked out a solution by putting a Frame, HScrollbar and VScrollbar controls on the form and associated code to scroll the frame as per the scrollbar positions. The actual controls were placed on the Frame control. This approach to my problem requires me to repeat this in each form I create.

    Is there another way to resolve my problem (There must be). Please help me out. I am sure other VB developers must have confronted similar situations in MDI system.

    Thanks everybody
    Girish Chandra


  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Scrolling Forms

    I'm afraid that it's an all to common problem / short coming of VB that this happens. However, vbAccelerator have a class/control that allows you to add scrollbars to just about any container control.

    Look for it at http://vbaccelerator.com

    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

  3. #3
    Guest

    Re: Scrolling Forms

    Couldn't you create a template of a blank form with the scroll bars and associated code?


  4. #4
    Join Date
    Nov 1999
    Location
    Los Angeles, CA
    Posts
    5

    Re: Scrolling Forms

    I have a similar problem which I posted today. Here it is:
    I have a long form contained within a picture box. I am using both horizontal and vertical scroll bars.
    I would like to have my application automatically scroll when the cursor has
    reached the edge of the screen. This would make it more practical from a
    users standpoint. Currently, when the cursor reaches the edge of the screen,
    the user has to manually slide the scroll bar.

    If you have solved your problem, mine seems very similar. Do you have any suggestions?


  5. #5
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Scrolling Forms

    You can catch the GotFocus event on the controls and determine if that control is visible or not based on current Scrollbar position/value. THen you can set the scoll value such that the control is visible.

    You might write a generic "OnFocus" routine which will take the focus control as input and automatically does this thing. Then add a single line of code in all control's GotFocus events to invoke this function with appropriate param.

    I dont how you are implementing it. I would assign the scaleWidth/height value of the Form to the scrollbars values. So that when i set vScroll.value = Command1.top, it should automatically show the control command1

    RK

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured