バージョン

TextPlacement プロパティ

画像に基づいて GalleryItem のテキストの配置を決定する値を取得または設定します。
シンタックス
'宣言
 
Public Property TextPlacement As TextPlacement
public TextPlacement TextPlacement {get; set;}
使用例
Imports System
 Imports System.Windows
 Imports Infragistics.Windows.Ribbon


Namespace MyNamespace
	Public Partial Class MyWindow
		Inherits XamRibbonWindow
		Public Sub New()
			InitializeComponent()
		End Sub

		Protected Sub LoadGalleryTool()
			Dim setting As New GalleryItemSettings()
			setting.TextDisplayMode = GalleryItemTextDisplayMode.Always
			setting.TextPlacement = TextPlacement.AboveImage
			setting.SelectionDisplayMode = GalleryItemSelectionDisplayMode.HighlightEntireItem
			setting.HorizontalTextAlignment = TextAlignment.Center
			setting.VerticalTextAlignment = VerticalAlignment.Top

			....

			Dim item As New GalleryItem()
			item.Key = "Item10
			item.Text = "Item10"
			item.Image = New BitmapImage(New Uri("\Images\ig_office_icon_16.png", UriKind.Relative))
			item.Tag = "myTag"
			item.Settings = settings
			galleryTool.Items.Add(item)

			.....

		End Sub
	End Class
End Namespace
using System;
using System.Windows;
using Infragistics.Windows.Ribbon;


namespace MyNamespace
{
    public partial class MyWindow : XamRibbonWindow
    {
        public MyWindow()
        {
            InitializeComponent();
        }

        protected void LoadGalleryTool()
        {
            GalleryItemSettings setting = new GalleryItemSettings();
            setting.TextDisplayMode = GalleryItemTextDisplayMode.Always;
            setting.TextPlacement = TextPlacement.AboveImage;
            setting.SelectionDisplayMode = GalleryItemSelectionDisplayMode.HighlightEntireItem;
            setting.HorizontalTextAlignment = TextAlignment.Center;
            setting.VerticalTextAlignment = VerticalAlignment.Top;

            GalleryItem item = new GalleryItem();
            item.Key = "Item10";
            item.Text = "Item10";
            item.Image = new BitmapImage(new Uri("\\Images\\ig_office_icon_16.png", UriKind.Relative));
            item.Tag = "myTag";
            item.Settings = settings;

            galleryTool.Items.Add(item);
        }
    }
}
<igRibbon:XamRibbonWindow x:Class="MyWindow"
    
xmlns:igRibbon="http://infragistics.com/Ribbon"
    
xmlns:s="clr-namespace:System;assembly=mscorlib">

  ....

    
<igRibbon:RibbonGroup Id="groupId" Caption="Group">
        
<igRibbon:MenuTool ShouldDisplayGalleryPreview="True" Caption="GalleryToolMenu">
            
<igRibbon:GalleryTool Name="galleryToolItems" >
                
<igRibbon:GalleryTool.Items> 
                    
<igRibbon:GalleryItem Key="Item1" Text="Item1" Image="\Images\ig_office_icon_16.png"/>
                    
<igRibbon:GalleryItem Key="Item2" Text="Item2" Image="\Images\ig_office_icon_16.png"/>
                    
<igRibbon:GalleryItem Key="Item3" Text="Item3" Image="\Images\ig_office_icon_16.png"/>
                    
<igRibbon:GalleryItem Key="Item4" Text="Item4" Image="\Images\ig_office_icon_16.png"/>
                    
<igRibbon:GalleryItem Key="Item5" Text="Item5" Image="\Images\ig_office_icon_16.png" ColumnSpan="3"/>
                    
<igRibbon:GalleryItem Key="Item6" Text="Item6" Image="\Images\ig_office_icon_16.png"/>
                    
<igRibbon:GalleryItem Key="Item7" Text="Item7" Image="\Images\ig_office_icon_16.png" Tag="myTag"/>
                    
<igRibbon:GalleryItem Key="Item8" Text="Item8" Image="\Images\ig_office_icon_16.png"/>
                    
<igRibbon:GalleryItem Key="Item9" Text="Item9" Image="\Images\ig_office_icon_16.png" IsSelected="True"/>
                    
                    
<!-- set only one item setting -->
                    
<igRibbon:GalleryItem Key="Item10" Text="Item10" Image="\Images\ig_office_icon_16.png">
                        
<igRibbon:GalleryItem.Settings>
                            
<igRibbon:GalleryItemSettings 
                                
TextDisplayMode="Always" 
                                
TextPlacement="AboveImage" 
                                
HorizontalTextAlignment="Center"
                                
VerticalTextAlignment="Top"
                                
SelectionDisplayMode="HighlightEntireItem"/>
                        
</igRibbon:GalleryItem.Settings>
                    
</igRibbon:GalleryItem>
                    
                    
<igRibbon:GalleryItem Key="Item11" Text="Item11" Image="\Images\ig_office_icon_16.png"/>
                
</igRibbon:GalleryTool.Items>
            
</igRibbon:GalleryTool>
        
</igRibbon:MenuTool>
    
</igRibbon:RibbonGroup> 

  ....

</igRibbon:XamRibbonWindow>
参照