PanelStyle.Wrap プロパティ

定義

パネルの内容をラップするかどうかを示す値を取得または設定します。

public:
 virtual property bool Wrap { bool get(); void set(bool value); };
public virtual bool Wrap { get; set; }
member this.Wrap : bool with get, set
Public Overridable Property Wrap As Boolean

プロパティ値

パネルの内容をラップする場合は true。それ以外の場合は false。 既定値は、true です。

次のコード例では、 WrapPanel1Panel2と の 2 つのパネル コントロールの プロパティを にfalse設定します。 このコード例は、PanelStyle クラスのために提供されている大規模な例の一部です。

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

注釈

プロパティは Wrap 、コンテンツがパネル内でラップされるかどうかを示します。 プロパティが Wrapfalse 設定され、 ScrollBars プロパティが に Auto設定されている場合、パネルの内容がパネルに収まる内容より長い場合、パネルの内容は水平スクロール バーのある 1 行に表示されます。 プロパティが Wrapfalse 設定され、 ScrollBars プロパティが に None設定されている場合、パネルは拡張され、必要に応じて Web ページには水平スクロール バーが表示されます。

適用対象