DataGridViewElementStates 열거형

정의

DataGridView 컨트롤에서 요소의 UI(사용자 인터페이스) 상태를 지정합니다.

이 열거형은 멤버 값의 비트 조합을 지원합니다.

public enum class DataGridViewElementStates
[System.Flags]
[System.Runtime.InteropServices.ComVisible(true)]
public enum DataGridViewElementStates
[System.Flags]
public enum DataGridViewElementStates
[<System.Flags>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type DataGridViewElementStates = 
[<System.Flags>]
type DataGridViewElementStates = 
Public Enum DataGridViewElementStates
상속
DataGridViewElementStates
특성

필드

Displayed 1

요소가 현재 화면에 표시되어 있음을 나타냅니다.

Frozen 2

요소가 UI를 통해 스크롤될 수 없음을 나타냅니다.

None 0

요소가 기본 상태에 있음을 나타냅니다.

ReadOnly 4

요소의 값을 변경하기 위해 사용자가 입력할 수 없음을 나타냅니다.

Resizable 8

UI를 통해 요소의 크기를 조정할 수 있음을 나타냅니다. ResizableSet 값과 함께 사용되는 경우를 제외하고는 이 값은 무시됩니다.

ResizableSet 16

요소가 부모의 크기 조정 가능한 상태를 상속하지 않음을 나타냅니다.

Selected 32

요소가 선택한 UI 상태에 있음을 나타냅니다.

Visible 64

요소가 표시됨을 나타냅니다.

예제

다음 코드 예제에서는이 형식의 사용을 보여 줍니다. 자세한 내용은 방법: Windows Forms DataGridView 컨트롤의 셀 변경 내용에 따라 사용자 지정 작업 수행을 참조하세요.

private void dataGridView1_CellStateChanged(object sender,
    DataGridViewCellStateChangedEventArgs e)
{
    DataGridViewElementStates state = e.StateChanged;
    string msg = String.Format("Row {0}, Column {1}, {2}",
        e.Cell.RowIndex, e.Cell.ColumnIndex, e.StateChanged);
    MessageBox.Show(msg, "Cell State Changed");
}
Private Sub dataGridView1_CellStateChanged(ByVal sender As Object, _
    ByVal e As DataGridViewCellStateChangedEventArgs) _
    Handles dataGridView1.CellStateChanged

    Dim state As DataGridViewElementStates = e.StateChanged
    Dim msg As String = String.Format( _
        "Row {0}, Column {1}, {2}", _
        e.Cell.RowIndex, e.Cell.ColumnIndex, e.StateChanged)
    MessageBox.Show(msg, "Cell State Changed")

End Sub

설명

Frozen과 같은 이러한 다른 상태는 UI에 의해 적용되지만 프로그래밍 방식으로 재정의될 수 있습니다.

적용 대상

추가 정보