Forum  General Visual ...  How do I...?  Panel with only vertical scrollbar
Previous Previous
 
Next Next
New Post 7/13/2012 7:17 AM
Resolved
  bacon182
46 posts
No Ranking


Panel with only vertical scrollbar 

I'm starting to make something like a chat, and then I have a flowlayoutpanel that I add a UserControl with the messages setting (message, date, user, etc) for each message, but, I need this panel to have a scrollbar vertically for multiple messages that goes beyond his height. I tried to set the autoscroll property but then, it gives me a vertical AND horizontal scrollbar, but horizontal is something i dont want.

 

There is anyway to only force the vertical and no horizontal?

 
New Post 7/25/2012 12:30 PM
  palli
14324 posts
1st Level Poster




Re: Panel with only vertical scrollbar 

 Hi,

According to this you can also use a normal Panel and then dock your added UserControls to the top.

In any case, the easiest way (which also holds true for most scrollable controls) is to create a custom control and explose the HScroll and VScroll properties. You could to it with this code for instance:

 

    [Serializable()]
    public class MyPanel : FlowLayoutPanel
    {
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public bool myHScroll
        {
            get { return base.HScroll; }
            set { base.HScroll = value; }
        }
 
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public bool myVScroll
        {
            get { return base.VScroll; }
            set { base.VScroll = value; }
        }
    }

 

Then you simply set MyPanel.myHScroll = False and you're done.

Hope this helps,

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 7/26/2012 10:26 AM
  bacon182
46 posts
No Ranking


Re: Panel with only vertical scrollbar 

 Thanks Palli, it worked as I needed. (=

 
New Post 7/26/2012 4:43 PM
  palli
14324 posts
1st Level Poster




Re: Panel with only vertical scrollbar 

 Hi,

You are welcome and thanks for the confirmation.

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
Previous Previous
 
Next Next
  Forum  General Visual ...  How do I...?  Panel with only vertical scrollbar
.NET HTML5 Web, Cloud and Mobile application delivery | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2012 Visual WebGui®       Visual WebGui weblog on ASP.NET Gizmox Blog Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS