DataGridViewElementStates Výčet

Definice

Určuje stav uživatelského rozhraní prvku v ovládacím prvku DataGridView.

Tento výčet podporuje bitové kombinace hodnot jeho členů.

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
Dědičnost
DataGridViewElementStates
Atributy

Pole

Name Hodnota Description
None 0

Označuje, že prvek je ve výchozím stavu.

Displayed 1

Označuje, že prvek je aktuálně zobrazen na obrazovce.

Frozen 2

Označuje, že prvek nelze procházet v uživatelském rozhraní.

ReadOnly 4

Označuje, že prvek nepřijme vstup uživatele ke změně jeho hodnoty.

Resizable 8

Označuje, že prvek lze změnit pomocí uživatelského rozhraní. Tato hodnota se ignoruje, s výjimkou případů, kdy je ResizableSet tato hodnota zkombinovaná s hodnotou.

ResizableSet 16

Označuje, že prvek nedědí stav změny velikosti nadřazeného objektu.

Selected 32

Označuje, že prvek je ve vybraném (zvýrazněném) stavu uživatelského rozhraní.

Visible 64

Označuje, že je prvek viditelný (zobrazitelný).

Příklady

Následující příklad kódu znázorňuje použití tohoto typu. Další informace najdete v tématu How to: Provedení vlastní akce na základě změn v buňce ovládacího prvku model 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

Poznámky

I když uživatelské rozhraní vynucuje tyto různé stavy, jako je Frozen, můžou být programově přerušovány.

Platí pro

Viz také