DataGridViewTriState DataGridViewTriState DataGridViewTriState DataGridViewTriState Enum

定义

定义用于指定三种可能状态之一的值。Defines values for specifying one of three possible states.

public enum class DataGridViewTriState
public enum DataGridViewTriState
type DataGridViewTriState = 
Public Enum DataGridViewTriState
继承
DataGridViewTriStateDataGridViewTriStateDataGridViewTriStateDataGridViewTriState

字段

False False False False 2

此属性的状态为 falseThe property's state is false.

NotSet NotSet NotSet NotSet 0

此属性尚未设置,将采用默认方式。The property is not set and will behave in a default manner.

True True True 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属性属于类型DataGridViewTriState以便DataGridViewCellStyle对象可以指示文本换行的一个单元值,对于没有首选项,而是可以指示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.

适用于

另请参阅