PanelStyle.HorizontalAlign Eigenschap

Definitie

Hiermee haalt u de horizontale uitlijning van de inhoud in een configuratiescherm op of stelt u deze in.

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

Waarde van eigenschap

Een van de HorizontalAlign waarden. De standaardwaarde is NotSet.

Uitzonderingen

De horizontale uitlijning is geen van de HorizontalAlign waarden.

Voorbeelden

In het volgende codevoorbeeld worden de HorizontalAlign eigenschappen van twee paneelbesturingselementen Panel1 ingesteld en Panel2op de HorizontalAlign.Center opsommingswaarde. Zie het onderwerp voor een .aspx-bestand dat kan worden gebruikt om het PanelStyle voorbeeld uit te voeren.

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

Opmerkingen

De HorizontalAlign eigenschap geeft de horizontale uitlijning van de inhoud binnen een configuratiescherm.

De HorizontalAlign eigenschap wordt ingesteld met behulp van een van de HorizontalAlign opsommingswaarden. De volgende tabel bevat de mogelijke waarden.

Waarde Beschrijving
NotSet De horizontale uitlijning is niet ingesteld.
Left De inhoud van het deelvenster wordt links uitgelijnd.
Center De inhoud van het deelvenster is gecentreerd.
Right De inhoud van het deelvenster is rechts uitgelijnd.

Note

. Als de HorizontalAlign eigenschap is ingesteld op NotSet maar de eigenschap is ingesteld in het besturingselement dat het paneelbesturingselement bevat, wordt de instelling overgenomen van het betreffende besturingselement.

Van toepassing op

Zie ook