DesignerAutoFormatStyle.VerticalAlign プロパティ
アセンブリ: System.Design (system.design.dll 内)
構文Dim instance As DesignerAutoFormatStyle Dim value As VerticalAlign value = instance.VerticalAlign instance.VerticalAlign = value
public: property VerticalAlign VerticalAlign { VerticalAlign get (); void set (VerticalAlign value); }
/** @property */ public VerticalAlign get_VerticalAlign () /** @property */ public void set_VerticalAlign (VerticalAlign value)
public function get VerticalAlign () : VerticalAlign public function set VerticalAlign (value : VerticalAlign)
VerticalAlign 値の 1 つ。既定値は NotSet です。
解説VerticalAlign プロパティを使用して、関連付けられているコントロールの内容の垂直方向の配置を指定します。関連付けられているコントロールに VerticalAlign プロパティが適用されない場合、この設定は無視されます。垂直方向の配置に関する定義済みの値については、「VerticalAlign」を参照してください。
使用例DesignerAutoFormat オブジェクトと Style プロパティを使用してコントロールに書式を適用する方法を次のコード例に示します。
' Applies styles based on the Name of the AutoFormat Public Overrides Sub Apply(ByVal inLabel As Control) If TypeOf inLabel Is IndentLabel Then Dim ctl As IndentLabel = CType(inLabel, IndentLabel) ' Apply formatting according to the Name If Me.Name.Equals("MyClassic") Then ' For MyClassic, apply style elements directly to the control ctl.ForeColor = Color.Gray ctl.BackColor = Color.LightGray ctl.Font.Size = FontUnit.XSmall ctl.Font.Name = "Verdana,Geneva,Sans-Serif" ElseIf Me.Name.Equals("MyBright") Then ' For MyBright, apply style elements to the Style object Me.Style.ForeColor = Color.Maroon Me.Style.BackColor = Color.Yellow Me.Style.Font.Size = FontUnit.Medium ' Merge the AutoFormat style with the control's style ctl.MergeStyle(Me.Style) Else ' For the Default format, apply style elements to the control ctl.ForeColor = Color.Black ctl.BackColor = Color.Empty ctl.Font.Size = FontUnit.XSmall End If End If End Sub
// Applies styles based on the Name of the AutoFormat public override void Apply(Control inLabel) { if (inLabel is IndentLabel) { IndentLabel ctl = (IndentLabel)inLabel; // Apply formatting according to the Name if (this.Name == "MyClassic") { // For MyClassic, apply style elements directly to the control ctl.ForeColor = Color.Gray; ctl.BackColor = Color.LightGray; ctl.Font.Size = FontUnit.XSmall; ctl.Font.Name = "Verdana,Geneva,Sans-Serif"; } else if (this.Name == "MyBright") { // For MyBright, apply style elements to the Style property this.Style.ForeColor = Color.Maroon; this.Style.BackColor = Color.Yellow; this.Style.Font.Size = FontUnit.Medium; // Merge the AutoFormat style with the control's style ctl.MergeStyle(this.Style); } else { // For the Default format, apply style elements to the control ctl.ForeColor = Color.Black; ctl.BackColor = Color.Empty; ctl.Font.Size = FontUnit.XSmall; } } }
.NET Framework のセキュリティ
プラットフォームWindows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照- DesignerAutoFormatStyle.VerticalAlign プロパティのページへのリンク