PanelStyle.BackImageUrl Propriété

Définition

Obtient ou définit l'URL de l'image d'arrière-plan du contrôle du volet.

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

Valeur de propriété

URL de l'image d'arrière-plan du contrôle du volet. La valeur par défaut est une chaîne vide ("").

Exceptions

La propriété BackImageUrl a la valeur null.

Exemples

L’exemple de code suivant applique la même image d’arrière-plan à deux contrôles de panneau, Panel1 et Panel2. Pour que cet exemple fonctionne correctement, vous devez fournir votre propre image. Cet exemple de code fait partie d’un exemple plus grand fourni pour la PanelStyle classe .

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

Remarques

La BackImageUrl propriété spécifie l’URL de l’image d’arrière-plan pour le contrôle du panneau. Pour que cette propriété fonctionne, un fichier image doit exister à l’emplacement spécifié. Si le fichier image spécifié n’est pas accessible, le contrôle du panneau s’affiche sans image d’arrière-plan.

S’applique à