Results 1 to 3 of 3

Thread: Make visable HScrollBar for panel when the panels contents exceed boundaries.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2013
    Posts
    66

    Make visable HScrollBar for panel when the panels contents exceed boundaries.

    Hello.

    I have a panel that I add controls to.
    I will add and use the HScrollBar control to the right of the panel so that I can scroll across when the number of controls displayed in the panel exceeds the of the panel boundaries.
    I do not wish to use the AutoScoll on the panel.
    I would like to only display the HScrollBar when it is needed, ie when the panel is over full.

    My question is how do you detect when the contents of the panel exceed its boundaries so that i know when to make the HScrollBar visable?

    Thank you.

  2. #2
    Member
    Join Date
    Oct 2013
    Location
    Norway; Haugesund
    Posts
    39

    Re: Make visable HScrollBar for panel when the panels contents exceed boundaries.

    From experience, I recommend using the AutoScroll function if you're only going to scroll. It has less glitches, and works way better than doing it manually. But since you don't want to use this function, I will try to help you with a solution anyway.

    If you have items which are added at run time, you could simply create a class which gets the size of the new items added, how many items added, and calculate from that point. If I only have 3 items in my panel with a normal size, which does not get out of the boundaries, I can calculate how much space those items need, and then hide the HScrollbar until a new item is added. If you're an experienced VB coder, you could easily work out from these points. If you don't get any ideas, I will try to lend some assistance. But then I would perhaps need some of your code and GUI, if I'm going to be able to help efficiency.

    With kind regards,

    - Frek

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2013
    Posts
    66

    Re: Make visable HScrollBar for panel when the panels contents exceed boundaries.

    My question is how do you detect when the contents of the panel exceed its boundaries so that i know when to make the HScrollBar visable?

    If you dont know thats OK Frek. Someone out there will.

    Thank you.

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