Bagikan melalui


PanelStyle.ScrollBars Properti

Definisi

Mendapatkan atau mengatur visibilitas dan posisi bilah gulir dalam kontrol panel.

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

Nilai Properti

Salah ScrollBars satu nilai. Defaultnya adalah None.

Pengecualian

Properti ScrollBars bukan salah ScrollBars satu nilai.

Contoh

Contoh kode berikut mengatur ScrollBars properti dua kontrol panel, Panel1 dan Panel2, ke ScrollBars.Both nilai enumerasi. Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk PanelStyle kelas .

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

Keterangan

Properti ScrollBars menentukan visibilitas dan posisi bilah gulir dalam kontrol panel.

Properti ScrollBars diatur menggunakan salah ScrollBars satu nilai enumerasi. Tabel berikut ini mencantumkan nilai yang mungkin.

Nilai Deskripsi
None Tidak ada bilah gulir yang ditampilkan.
Horizontal Hanya bilah gulir horizontal yang ditampilkan.
Vertical Hanya bilah gulir vertikal yang ditampilkan.
Both Bilah gulir horizontal dan vertikal ditampilkan.
Auto Jika perlu, horizontal, vertikal, atau kedua bilah gulir ditampilkan. Jika tidak, tidak ada bilah gulir yang ditampilkan.

Berlaku untuk

Lihat juga