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除了Boolean类型的两个状态之外还需要第三个状态时, 枚举非常有用。The DataGridViewTriState enumeration is useful whenever a third state is needed in addition to the two states of the Boolean type. 例如DataGridViewCellStyle.WrapMode , 属性的类型DataGridViewCellStyle DataGridViewTriState为, 以便对象可以指示对于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.

适用于

另请参阅