DataGridViewTriState 列舉

定義

定義值來指定三個可能狀態的其中一個。Defines values for specifying one of three possible states.

public enum class DataGridViewTriState
public enum DataGridViewTriState
type DataGridViewTriState = 
Public Enum DataGridViewTriState
繼承
DataGridViewTriState

欄位

False 2

此屬性的狀態為 falseThe property's state is false.

NotSet 0

未設定這個屬性,其行為將會是預設方式。The property is not set and will behave in a default manner.

True 1

此屬性的狀態為 trueThe property's state is true.

範例

下列程式碼範例說明如何使用此類型。The following code example illustrates the use of this type.

this.dataGridView1.DefaultCellStyle.WrapMode =
    DataGridViewTriState.True;
Me.dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True

備註

DataGridViewTriState當除了類型的兩個狀態以外,需要第三個狀態時,列舉會很有用 BooleanThe DataGridViewTriState enumeration is useful whenever a third state is needed in addition to the two states of the Boolean type. 例如, DataGridViewCellStyle.WrapMode 屬性的類型是, DataGridViewTriStateDataGridViewCellStyle 物件可以在資料格值的文字換行中指出沒有喜好設定,而可以改為指示 WrapMode DataGridViewCellStyle 應該使用不同物件的值。For example, the DataGridViewCellStyle.WrapMode property is of type DataGridViewTriState so that a DataGridViewCellStyle object can indicate no preference in regards to the text wrapping of a cell value, and can instead indicate that the WrapMode value of a different DataGridViewCellStyle object should be used.

適用於

另請參閱