DataGridViewImageCell 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
컨트롤에 그래픽을 표시합니다 DataGridView .
public ref class DataGridViewImageCell : System::Windows::Forms::DataGridViewCell
public class DataGridViewImageCell : System.Windows.Forms.DataGridViewCell
type DataGridViewImageCell = class
inherit DataGridViewCell
Public Class DataGridViewImageCell
Inherits DataGridViewCell
- 상속
예제
다음 코드 예제에서는 를 사용하여 DataGridViewCell이미지 셀의 이미지를 변경하는 방법을 보여 줍니다. 이 코드 예제는 방법: Windows Forms DataGridView 컨트롤의 이미지 열 작업 항목에 대해 제공되는 더 큰 예제의 일부입니다.
void dataGridView1_CellClick( Object^ sender, DataGridViewCellEventArgs^ e )
{
if ( turn->Equals( gameOverString ) )
{
return;
}
DataGridViewImageCell^ cell = dynamic_cast<DataGridViewImageCell^>(dataGridView1->Rows[ e->RowIndex ]->Cells[ e->ColumnIndex ]);
if ( cell->Value == blank )
{
if ( IsOsTurn() )
{
cell->Value = o;
}
else
{
cell->Value = x;
}
ToggleTurn();
}
if ( IsAWin( cell ) )
{
turn->Text = gameOverString;
}
}
private void dataGridView1_CellClick(object sender,
DataGridViewCellEventArgs e)
{
if (turn.Text.Equals(gameOverString)) { return; }
DataGridViewImageCell cell = (DataGridViewImageCell)
dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex];
if (cell.Value == blank)
{
if (IsOsTurn())
{
cell.Value = o;
}
else
{
cell.Value = x;
}
ToggleTurn();
}
if (IsAWin())
{
turn.Text = gameOverString;
}
}
Private Sub dataGridView1_CellClick(ByVal sender As Object, _
ByVal e As DataGridViewCellEventArgs) _
Handles dataGridView1.CellClick
If turn.Text.Equals(gameOverString) Then Return
Dim cell As DataGridViewImageCell = _
CType(dataGridView1.Rows(e.RowIndex). _
Cells(e.ColumnIndex), DataGridViewImageCell)
If (cell.Value Is blank) Then
If IsOsTurn() Then
cell.Value = o
Else
cell.Value = x
End If
ToggleTurn()
ToolTip(e)
End If
If IsAWin() Then
turn.Text = gameOverString
End If
End Sub
설명
DataGridViewImageCell 클래스는 속성 값 DataGridViewCell 에 ValueIsIcon 따라 표시 하거나 Icon표시 Image 하는 데 사용 되는 특수 한 형식입니다. 일반적으로 ReadOnlyDataGridViewImageCell 속성은 사용자가 셀 내용을 편집할 수 없음을 나타내도록 true 설정됩니다.
이 DataGridViewImageColumn 형식의 셀을 보유하도록 특수화된 열 형식입니다. 기본적으로 새 DataGridViewImageColumn.CellTemplate 로 DataGridViewImageCell초기화됩니다. 기존 DataGridViewImageCell열 뒤의 열 내 셀을 패턴화하려면 열의 CellTemplate 속성을 패턴으로 사용할 셀로 설정합니다.
열의 셀 관련 속성은 템플릿 셀의 비슷한 이름의 속성에 대한 래퍼입니다. 템플릿 셀의 속성 값을 변경하면 변경 후 추가된 템플릿을 기반으로 하는 셀에만 영향을 미칩니다. 그러나 열의 셀 관련 속성 값을 변경하면 템플릿 셀과 열의 다른 모든 셀이 업데이트되고 필요한 경우 열 표시를 새로 고칩니다.
상속자 참고
파생된 클래스에서 DataGridViewImageCell 파생되고 새 속성을 추가하는 경우 복제 작업 중에 새 속성을 복사하도록 메서드를 재정 Clone() 의해야 합니다. 기본 클래스의 Clone() 속성이 새 셀에 복사되도록 기본 클래스의 메서드를 호출해야 합니다.
생성자
| Name | Description |
|---|---|
| DataGridViewImageCell() |
클래스의 DataGridViewImageCell 새 인스턴스를 초기화하여 개체 이외의 Icon 셀 값과 함께 사용하도록 구성합니다. |
| DataGridViewImageCell(Boolean) |
필요에 따라 클래스의 새 인스턴스를 DataGridViewImageCell 초기화하여 셀 값과 함께 Icon 사용하도록 구성합니다. |
속성
| Name | Description |
|---|---|
| AccessibilityObject |
에 DataGridViewCell.DataGridViewCellAccessibleObject 할당된 값을 DataGridViewCell가져옵니다. (다음에서 상속됨 DataGridViewCell) |
| ColumnIndex |
이 셀의 열 인덱스입니다. (다음에서 상속됨 DataGridViewCell) |
| ContentBounds |
셀의 콘텐츠 영역을 둘러싸는 경계 사각형을 가져옵니다. (다음에서 상속됨 DataGridViewCell) |
| ContextMenuStrip |
셀과 연결된 바로 가기 메뉴를 가져오거나 설정합니다. (다음에서 상속됨 DataGridViewCell) |
| DataGridView |
DataGridView 이 요소와 연결된 컨트롤을 가져옵니다. (다음에서 상속됨 DataGridViewElement) |
| DefaultNewRowValue |
새 행을 만들 때 사용되는 기본값을 가져옵니다. |
| Description |
이미지와 연결된 텍스트를 가져오거나 설정합니다. |
| Displayed |
셀이 현재 화면에 표시되는지 여부를 나타내는 값을 가져옵니다. (다음에서 상속됨 DataGridViewCell) |
| EditedFormattedValue |
셀이 편집 모드에 있고 값이 커밋되지 않았는지 여부에 관계없이 셀의 서식이 지정된 현재 값을 가져옵니다. (다음에서 상속됨 DataGridViewCell) |
| EditType |
셀의 호스트된 편집 컨트롤의 형식을 가져옵니다. |
| ErrorIconBounds |
셀에 대한 오류 아이콘의 범위를 가져옵니다. (다음에서 상속됨 DataGridViewCell) |
| ErrorText |
셀과 연결된 오류 조건을 설명하는 텍스트를 가져오거나 설정합니다. (다음에서 상속됨 DataGridViewCell) |
| FormattedValue |
표시할 서식이 지정된 셀의 값을 가져옵니다. (다음에서 상속됨 DataGridViewCell) |
| FormattedValueType |
셀과 연결된 서식이 지정된 값의 형식을 가져옵니다. |
| Frozen |
셀이 고정되었는지 여부를 나타내는 값을 가져옵니다. (다음에서 상속됨 DataGridViewCell) |
| HasStyle |
속성이 설정되었는지 여부를 Style 나타내는 값을 가져옵니다. (다음에서 상속됨 DataGridViewCell) |
| ImageLayout |
셀의 그래픽 레이아웃을 가져오거나 설정합니다. |
| InheritedState |
해당 행 및 열의 상태에서 상속된 셀의 현재 상태를 가져옵니다. (다음에서 상속됨 DataGridViewCell) |
| InheritedStyle |
셀에 현재 적용된 스타일을 가져옵니다. (다음에서 상속됨 DataGridViewCell) |
| IsInEditMode |
이 셀이 현재 편집 중인지 여부를 나타내는 값을 가져옵니다. (다음에서 상속됨 DataGridViewCell) |
| OwningColumn |
이 셀이 포함된 열을 가져옵니다. (다음에서 상속됨 DataGridViewCell) |
| OwningRow |
이 셀이 들어 있는 행을 가져옵니다. (다음에서 상속됨 DataGridViewCell) |
| PreferredSize |
셀이 들어갈 수 있는 사각형 영역의 크기를 픽셀 단위로 가져옵니다. (다음에서 상속됨 DataGridViewCell) |
| ReadOnly |
셀의 데이터를 편집할 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다. (다음에서 상속됨 DataGridViewCell) |
| Resizable |
셀 크기를 조정할 수 있는지 여부를 나타내는 값을 가져옵니다. (다음에서 상속됨 DataGridViewCell) |
| RowIndex |
셀의 부모 행 인덱스입니다. (다음에서 상속됨 DataGridViewCell) |
| Selected |
셀이 선택되었는지 여부를 나타내는 값을 가져오거나 설정합니다. (다음에서 상속됨 DataGridViewCell) |
| Size |
셀의 크기를 가져옵니다. (다음에서 상속됨 DataGridViewCell) |
| State |
요소의 UI(사용자 인터페이스) 상태를 가져옵니다. (다음에서 상속됨 DataGridViewElement) |
| Style |
셀의 스타일을 가져오거나 설정합니다. (다음에서 상속됨 DataGridViewCell) |
| Tag |
셀에 대한 추가 데이터가 포함된 개체를 가져오거나 설정합니다. (다음에서 상속됨 DataGridViewCell) |
| ToolTipText |
이 셀과 연결된 ToolTip 텍스트를 가져오거나 설정합니다. (다음에서 상속됨 DataGridViewCell) |
| Value |
이 셀과 연결된 값을 가져오거나 설정합니다. (다음에서 상속됨 DataGridViewCell) |
| ValueIsIcon |
이 셀에 값이 표시되는 Icon 지 여부를 나타내는 값을 가져오거나 설정합니다. |
| ValueType |
셀에 있는 값의 데이터 형식을 가져오거나 설정합니다. |
| Visible |
셀이 숨겨진 행이나 열에 있는지 여부를 나타내는 값을 가져옵니다. (다음에서 상속됨 DataGridViewCell) |