PanelStyle.Direction Egenskap
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Hämtar eller anger i vilken riktning du vill visa kontroller som innehåller text i en panelkontroll.
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
Egenskapsvärde
Ett av ContentDirection värdena. Standardvärdet är NotSet.
Undantag
Riktningen är inte ett av ContentDirection värdena.
Exempel
I följande kodexempel anges egenskaperna för Direction två panelkontroller Panel1 och Panel2, till ContentDirection.LeftToRight uppräkningsvärdet. Det här kodexemplet är en del av ett större exempel för PanelStyle klassen.
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
Kommentarer
Egenskapen Direction anger i vilken riktning du vill visa kontroller som innehåller text i en panelkontroll.
Egenskapen Direction anges med något av ContentDirection värdena. I följande tabell visas möjliga värden.
| Value | Description |
|---|---|
NotSet |
Innehållsriktningen har inte angetts. |
LeftToRight |
Underordnade kontroller som innehåller text visas från vänster till höger. |
RightToLeft |
Underordnade kontroller som innehåller text visas från höger till vänster. |
Om du anger LeftToRight, underordnade kontroller som innehåller textvisning från vänster till höger. Om du anger RightToLeft, underordnade kontroller som innehåller text som visas från höger till vänster. Använd RightToLeft för att visa text för språk som skrivs från höger till vänster, till exempel arabiska eller hebreiska.