PanelStyle.Direction Propiedad

Definición

Obtiene o establece la dirección en la que se muestran los controles que incluyen texto en un control de panel.

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

Valor de propiedad

ContentDirection

Uno de los valores de ContentDirection. De manera predeterminada, es NotSet.

Excepciones

La dirección no es ninguno de los valores de ContentDirection.

Ejemplos

En el ejemplo de código siguiente se establecen las Direction propiedades de dos controles de panel y Panel1 Panel2, en el valor de ContentDirection.LeftToRight enumeración. Este ejemplo de código forma parte de un ejemplo más grande proporcionado para la PanelStyle clase .

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

Comentarios

La Direction propiedad especifica la dirección en la que se muestran los controles que incluyen texto en un control de panel.

La Direction propiedad se establece mediante uno de los ContentDirection valores . En la tabla siguiente se enumeran los valores posibles.

Valor Descripción
NotSet No se establece la dirección del contenido.
LeftToRight Los controles secundarios que incluyen texto se muestran de izquierda a derecha.
RightToLeft Los controles secundarios que incluyen texto se muestran de derecha a izquierda.

Si especifica LeftToRight, los controles secundarios que incluyen la presentación de texto de izquierda a derecha. Si especifica RightToLeft, los controles secundarios que incluyen texto se muestran de derecha a izquierda. Use RightToLeft para mostrar el texto de los idiomas que se escriben de derecha a izquierda, como árabe o hebreo.

Se aplica a

Consulte también