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

Public Enumeration DataGridViewImageCellLayout

メンバ名 | 説明 | |
---|---|---|
Normal | グラフィックは、ネイティブな解像度を使用して中央に表示されます。 | |
NotSet | レイアウトの指定が設定されていません。 | |
Stretch | グラフィックは、配置先のセルの幅と高さに合うように、適切な比率で拡大されます。 | |
Zoom | グラフィックは、配置先のセルの幅または高さと同じ大きさになるように、均等に拡大されます。 |

この型の使用方法を次のコード例に示します。次の例は「方法 : Windows フォーム DataGridView コントロールのイメージ列を操作する」で取り上げている例の一部です。
Private Sub Stretch(ByVal sender As Object, _ ByVal e As EventArgs) Handles Button3.Click For Each column As DataGridViewImageColumn _ In dataGridView1.Columns column.ImageLayout = DataGridViewImageCellLayout.Stretch column.Description = "Stretched image layout" Next End Sub Private Sub ZoomToImage(ByVal sender As Object, _ ByVal e As EventArgs) Handles Button4.Click For Each column As DataGridViewImageColumn _ In dataGridView1.Columns column.ImageLayout = DataGridViewImageCellLayout.Zoom column.Description = "Zoomed image layout" Next End Sub Private Sub NormalImage(ByVal sender As Object, _ ByVal e As EventArgs) Handles Button5.Click For Each column As DataGridViewImageColumn _ In dataGridView1.Columns column.ImageLayout = DataGridViewImageCellLayout.Normal column.Description = "Normal image layout" Next End Sub
private void Stretch(object sender, EventArgs e) { foreach (DataGridViewImageColumn column in dataGridView1.Columns) { column.ImageLayout = DataGridViewImageCellLayout.Stretch; column.Description = "Stretched"; } } private void ZoomToImage(object sender, EventArgs e) { foreach (DataGridViewImageColumn column in dataGridView1.Columns) { column.ImageLayout = DataGridViewImageCellLayout.Zoom; column.Description = "Zoomed"; } } private void NormalImage(object sender, EventArgs e) { foreach (DataGridViewImageColumn column in dataGridView1.Columns) { column.ImageLayout = DataGridViewImageCellLayout.Normal; column.Description = "Normal"; } }

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


System.Windows.Forms 名前空間
DataGridViewImageCell.ImageLayout プロパティ
DataGridViewCell.PreferredSize プロパティ
- DataGridViewImageCellLayout 列挙体のページへのリンク