Permalink
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (38 sloc) 2.83 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
How to: Work with Image Columns in the Windows Forms DataGridView Control
03/30/2017
.net-framework
dotnet-winforms
article
jsharp
image columns
image columns, Windows Forms
DataGridView control [Windows Forms], image columns
8a37aa75-3c6e-4893-91d0-7a5f34bfe287
12
dotnet-bot
dotnetcontent
wpickett

How to: Work with Image Columns in the Windows Forms DataGridView Control

The following code example shows how to use the xref:System.Windows.Forms.DataGridView image columns in an interactive user interface (UI). The example also demonstrates image sizing and layout possibilities with the xref:System.Windows.Forms.DataGridViewImageColumn.

Example

[!code-cppSystem.Windows.Forms.DataGridView.ImageColumn_TicTacToe#0] [!code-csharpSystem.Windows.Forms.DataGridView.ImageColumn_TicTacToe#0] [!code-vbSystem.Windows.Forms.DataGridView.ImageColumn_TicTacToe#0]

Compiling the Code

This example requires:

  • References to the System and System.Windows.Forms assemblies.

For information about building this example from the command line for [!INCLUDEvbprvb] or [!INCLUDEcsprcs], see Building from the Command Line or Command-line Building With csc.exe. You can also build this example in [!INCLUDEvsprvs] by pasting the code into a new project. Also see How to: Compile and Run a Complete Windows Forms Code Example Using Visual Studio.

See Also

xref:System.Windows.Forms.DataGridView
xref:System.Windows.Forms.DataGridViewImageColumn
Programming with Cells, Rows, and Columns in the Windows Forms DataGridView Control
How to: Display Images in Cells of the Windows Forms DataGridView Control