* Merge winforms framework content to working branch (#14) * Breadcrumb / TOC / Move net5 to net folder (#15) * change path from net5 to net * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Add .net 5 winforms placeholder article (#16) * added some metadata and adjusted net5 placeholder * corrections * corrections * corrections * Test1 * Swapping landing page vs concept * fix links * Fix links * Fix desc
3.1 KiB
title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
| title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| How to: Change the Appearance of ToolStrip Text and Images | 03/30/2017 |
|
|
d62dc9d1-2edd-4dfa-aed7-1335d6e13d86 |
How to: Change the Appearance of ToolStrip Text and Images in Windows Forms
You can control whether text and images are displayed on a xref:System.Windows.Forms.ToolStripItem and how they are aligned relative to each other and the xref:System.Windows.Forms.ToolStrip.
To define what is displayed on a ToolStripItem
-
Set the xref:System.Windows.Forms.ToolStripItem.DisplayStyle%2A property to the desired value. The possibilities are
Image,ImageAndText,None, andText. The default isImageAndText.ToolStripButton2.DisplayStyle = _ System.Windows.Forms.ToolStripItemDisplayStyle.ImagetoolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
To align text on a ToolStripItem
-
Set the xref:System.Windows.Forms.ToolStripItem.TextAlign%2A property to the desired value. The possibilities are any combination of top, middle, and bottom with left, center, and right. The default is
MiddleCenter.ToolStripSplitButton1.TextAlign = _ System.Drawing.ContentAlignment.MiddleRighttoolStripSplitButton1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
To align an image on a ToolStripItem
-
Set the xref:System.Windows.Forms.ToolStripItem.ImageAlign%2A property to the desired value. The possibilities are any combination of top, middle, and bottom with left, center, and right. The default is
MiddleLeft.ToolStripSplitButton1.ImageAlign = _ System.Drawing.ContentAlignment.MiddleRighttoolStripSplitButton1.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
To define how ToolStripItem text and images are displayed relative to each other
-
Set the xref:System.Windows.Forms.ToolStripItem.TextImageRelation%2A property to the desired value. The possibilities are
ImageAboveText,ImageBeforeText,Overlay,TextAboveImage, andTextBeforeImage. The default isImageBeforeText.ToolStripButton1.TextImageRelation = _ System.Windows.Forms.TextImageRelation.ImageAboveTexttoolStripButton1.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;