PanelStyle.BackImageUrl Özellik

Tanım

Panel denetimi için arka plan görüntüsünün URL'sini alır veya ayarlar.

public:
 virtual property System::String ^ BackImageUrl { System::String ^ get(); void set(System::String ^ value); };
public virtual string BackImageUrl { get; set; }
member this.BackImageUrl : string with get, set
Public Overridable Property BackImageUrl As String

Özellik Değeri

Panel denetimi için arka plan görüntüsünün URL'si. Varsayılan değer boş bir dizedir ("").

Özel durumlar

BackImageUrl özelliğidirnull.

Örnekler

Aşağıdaki kod örneği, ve olmak üzere iki panel denetimine Panel1Panel2aynı arka plan görüntüsünü uygular. Bu örneğin doğru çalışması için kendi görüntünüzü sağlamanız gerekir. Bu kod örneği, sınıfı için PanelStyle sağlanan daha büyük bir örneğin parçasıdır.

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

Açıklamalar

özelliği, BackImageUrl panel denetimi için arka plan görüntüsünün URL'sini belirtir. Bu özelliğin çalışması için, belirtilen konumda bir görüntü dosyası bulunmalıdır. Belirtilen görüntü dosyasına erişilemiyorsa, panel denetimi arka plan görüntüsü olmadan görüntülenir.

Şunlara uygulanır