ToolStripItem.Alignment プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim instance As ToolStripItem Dim value As ToolStripItemAlignment value = instance.Alignment instance.Alignment = value
public: property ToolStripItemAlignment Alignment { ToolStripItemAlignment get (); void set (ToolStripItemAlignment value); }
/** @property */ public ToolStripItemAlignment get_Alignment () /** @property */ public void set_Alignment (ToolStripItemAlignment value)
public function get Alignment () : ToolStripItemAlignment public function set Alignment (value : ToolStripItemAlignment)
ToolStripItemAlignment 値の 1 つ。既定値は Left です。


Alignment プロパティを ToolStripItem.RightToLeft プロパティと共に使用して、ToolStrip 内の項目の配置を制御したり、既に配置されている項目を確認したりします。
ToolStripItem.RightToLeft プロパティが No の場合、Left として設定された項目は ToolStrip に左揃えで配置され、Right として設定された項目は右揃えで配置されます。
ToolStripItem.RightToLeft プロパティが Yes の場合、Left として設定された項目は ToolStrip に右揃えで配置され、Right として設定された項目は左揃えで配置されます。

Alignment プロパティを設定する方法を次のコード例に示します。このコード例は、ToolStripItem クラスのトピックで取り上げているコード例の一部分です。
' This utility method creates a RolloverItem ' and adds it to a ToolStrip control. Private Function CreateRolloverItem( _ ByVal owningToolStrip As ToolStrip, _ ByVal txt As String, _ ByVal f As Font, _ ByVal imgKey As String, _ ByVal tir As TextImageRelation, _ ByVal backImgKey As String) As RolloverItem Dim item As New RolloverItem() item.Alignment = ToolStripItemAlignment.Left item.AllowDrop = False item.AutoSize = True item.BackgroundImage = owningToolStrip.ImageList.Images(backImgKey) item.BackgroundImageLayout = ImageLayout.Center item.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText item.DoubleClickEnabled = True item.Enabled = True item.Font = f ' These assignments are equivalent. Each assigns an ' image from the owning toolstrip's image list. item.ImageKey = imgKey 'item.Image = owningToolStrip.ImageList.Images[infoIconKey]; 'item.ImageIndex = owningToolStrip.ImageList.Images.IndexOfKey(infoIconKey); item.ImageScaling = ToolStripItemImageScaling.None item.Owner = owningToolStrip item.Padding = New Padding(2) item.Text = txt item.TextAlign = ContentAlignment.MiddleLeft item.TextDirection = ToolStripTextDirection.Horizontal item.TextImageRelation = tir Return item End Function
// This utility method creates a RolloverItem // and adds it to a ToolStrip control. private RolloverItem CreateRolloverItem( ToolStrip owningToolStrip, string txt, Font f, string imgKey, TextImageRelation tir, string backImgKey) { RolloverItem item = new RolloverItem(); item.Alignment = ToolStripItemAlignment.Left; item.AllowDrop = false; item.AutoSize = true; item.BackgroundImage = owningToolStrip.ImageList.Images[backImgKey]; item.BackgroundImageLayout = ImageLayout.Center; item.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText; item.DoubleClickEnabled = true; item.Enabled = true; item.Font = f; // These assignments are equivalent. Each assigns an // image from the owning toolstrip's image list. item.ImageKey = imgKey; //item.Image = owningToolStrip.ImageList.Images[infoIconKey]; //item.ImageIndex = owningToolStrip.ImageList.Images.IndexOfKey(infoIconKey); item.ImageScaling = ToolStripItemImageScaling.None; item.Owner = owningToolStrip; item.Padding = new Padding(2); item.Text = txt; item.TextAlign = ContentAlignment.MiddleLeft; item.TextDirection = ToolStripTextDirection.Horizontal; item.TextImageRelation = tir; return item; }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ToolStripItemAlignment 列挙体
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Public Enumeration ToolStripItemAlignment

メンバ名 | 説明 | |
---|---|---|
Left | ToolStrip の向きに応じて、ToolStripItem を ToolStrip の左端または上端に固定するよう指定します。System.Windows.Forms.RightToLeft の値が Yes の場合、Left としてマークされた項目は、ToolStrip の右側に揃えられます。 | |
Right | ToolStrip の向きに応じて、ToolStripItem を ToolStrip の右端または下端に固定するよう指定します。System.Windows.Forms.RightToLeft の値が Yes の場合、Right としてマークされた項目は、ToolStrip の左側に揃えられます。 |

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からToolStripItem.Alignmentを検索する場合は、下記のリンクをクリックしてください。

- ToolStripItem.Alignmentのページへのリンク