PanelStyle.HorizontalAlign Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém ou define o alinhamento horizontal do conteúdo dentro de um controlo de painel.
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
Valor de Propriedade
Um dos HorizontalAlign valores. A predefinição é NotSet.
Exceções
O alinhamento horizontal não é um dos valores HorizontalAlign .
Exemplos
O exemplo de código seguinte define as HorizontalAlign propriedades de dois controlos de painel, Panel1 e Panel2, para o HorizontalAlign.Center valor de enumeração. Para um ficheiro .aspx que pode ser usado para executar o exemplo, veja o PanelStyle tópico.
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
Observações
A HorizontalAlign propriedade especifica o alinhamento horizontal do conteúdo dentro de um controlo de painel.
A HorizontalAlign propriedade é definida usando um dos HorizontalAlign valores de enumeração. A tabela seguinte lista os valores possíveis.
| Value | Descrição |
|---|---|
NotSet |
O alinhamento horizontal não está definido. |
Left |
O conteúdo do painel está alinhado à esquerda. |
Center |
O conteúdo do painel está centrado. |
Right |
O conteúdo do painel está alinhado à direita. |
Note
. Se a HorizontalAlign propriedade estiver definida como NotSet mas a propriedade estiver definida no controlo que contém o controlo do painel, a configuração é herdada do controlo que contém.