Link to home
Start Free TrialLog in
Avatar of mSchmidt
mSchmidt

asked on

VScrollbar on Panel, always visible

Hi

I have a application where i need a Panel to always show its Scrollbar even though it is currently not overflown.
The thing is that the size of the panels residing within the panel has to be the same at all times, because i have a fixed header which size is constant

An example of the issue.
http://www.scoding.dk/example.jpg

The scrollbar makes it out of sync.

Any ideas are welcome
Avatar of daveamour
daveamour
Flag of United Kingdom of Great Britain and Northern Ireland image

The attached code works for me.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PanelScrollBar.aspx.cs" Inherits="PanelScrollBar" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:Panel runat="server" ID="MyPanel" Width="400" Height="300" ScrollBars="Vertical" BorderColor="Beige" BorderStyle="Solid">
            <p>This is some text</p>
            <p>This is some text</p>
            <p>This is some text</p>
        </asp:Panel>
    </form>
</body>
</html>

Open in new window

Avatar of mSchmidt
mSchmidt

ASKER

sorry we are talking winforms.
Right sorry and the panel is a fixed size right?
correct, when adding additional elements, currently the scrollbar will pop up at some point.
ASKER CERTIFIED SOLUTION
Avatar of daveamour
daveamour
Flag of United Kingdom of Great Britain and Northern Ireland image

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