다음을 통해 공유


PanelStyle.ScrollBars 속성

정의

패널 컨트롤에서 스크롤 막대의 표시 유형 및 위치를 가져오거나 설정합니다.

public:
 virtual property System::Web::UI::WebControls::ScrollBars ScrollBars { System::Web::UI::WebControls::ScrollBars get(); void set(System::Web::UI::WebControls::ScrollBars value); };
public virtual System.Web.UI.WebControls.ScrollBars ScrollBars { get; set; }
member this.ScrollBars : System.Web.UI.WebControls.ScrollBars with get, set
Public Overridable Property ScrollBars As ScrollBars

속성 값

값 중 ScrollBars 하나입니다. 기본값은 None입니다.

예외

속성이 ScrollBars 값 중 ScrollBars 하나가 아닙니다.

예제

다음 코드 예제에서는 두 패널 컨트롤 Panel1Panel2의 속성을 열거형 값으로 ScrollBars.Both 설정합니다ScrollBars. 이 코드 예제는 클래스에 제공된 더 큰 예제의 PanelStyle 일부입니다.

public partial class PanelStylecs_aspx : Page
{
    void Page_Load(object sender, EventArgs e)
    {
        StateBag panelState = new StateBag();
        PanelStyle myPanelStyle = new PanelStyle(panelState);
        
        // Set the properties of the PanelStyle class.
        myPanelStyle.HorizontalAlign = HorizontalAlign.Center;
        myPanelStyle.ScrollBars = ScrollBars.Both;
        myPanelStyle.Wrap = false;
        myPanelStyle.Direction = ContentDirection.LeftToRight;
        myPanelStyle.BackImageUrl = @"~\images\picture.jpg";

        // Use the ApplyStyle method of the Panel control to apply
        // the settings from the myPanelStyle object.
        Panel1.ApplyStyle(myPanelStyle);
        Panel2.ApplyStyle(myPanelStyle); 
    }
}
Partial Class PanelStylevb_aspx
    Inherits Page

    Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

        Dim panelState As StateBag = New StateBag()
        Dim myPanelStyle As PanelStyle = New PanelStyle(panelState)

        ' Set the properties of the PanelStyle class.
        myPanelStyle.HorizontalAlign = HorizontalAlign.Center
        myPanelStyle.ScrollBars = ScrollBars.Both
        myPanelStyle.Wrap = False
        myPanelStyle.Direction = ContentDirection.LeftToRight
        myPanelStyle.BackImageUrl = "~\images\picture.jpg"

        ' Use the ApplyStyle method of the Panel control to apply
        ' the settings from the myPanelStyle object.
        Panel1.ApplyStyle(myPanelStyle)
        Panel2.ApplyStyle(myPanelStyle)
        
    End Sub

End Class

설명

이 속성은 ScrollBars 패널 컨트롤에서 스크롤 막대의 표시 유형과 위치를 지정합니다.

ScrollBars 속성은 열거형 값 중 ScrollBars 하나를 사용하여 설정됩니다. 다음 표에서는 가능한 값을 나열합니다.

가치 설명
None 스크롤 막대가 표시되지 않습니다.
Horizontal 가로 스크롤 막대만 표시됩니다.
Vertical 세로 스크롤 막대만 표시됩니다.
Both 가로 및 세로 스크롤 막대가 모두 표시됩니다.
Auto 필요한 경우 가로, 세로 또는 두 스크롤 막대가 모두 표시됩니다. 그렇지 않으면 스크롤 막대가 표시되지 않습니다.

적용 대상

추가 정보