DataGridViewAutoSizeColumnModeEventArgs DataGridViewAutoSizeColumnModeEventArgs DataGridViewAutoSizeColumnModeEventArgs DataGridViewAutoSizeColumnModeEventArgs Class

定义

AutoSizeColumnModeChanged 事件提供数据。Provides data for the AutoSizeColumnModeChanged event.

public ref class DataGridViewAutoSizeColumnModeEventArgs : EventArgs
public class DataGridViewAutoSizeColumnModeEventArgs : EventArgs
type DataGridViewAutoSizeColumnModeEventArgs = class
    inherit EventArgs
Public Class DataGridViewAutoSizeColumnModeEventArgs
Inherits EventArgs
继承
DataGridViewAutoSizeColumnModeEventArgsDataGridViewAutoSizeColumnModeEventArgsDataGridViewAutoSizeColumnModeEventArgsDataGridViewAutoSizeColumnModeEventArgs

示例

下面的代码示例演示如何使用此类型。The following code example illustrates the use of this type. 此示例摘自了如何:操作 Windows 窗体 DataGridView 控件中的列。This example is part of a larger example available in How to: Manipulate Columns in the Windows Forms DataGridView Control.

// Updated the criteria label.
void dataGridView_AutoSizeColumnModeChanged( Object^ /*sender*/, DataGridViewAutoSizeColumnModeEventArgs^ args )
{
   args->Column->DataGridView->Parent->Controls[ L"flowlayoutpanel" ]->Controls[ criteriaLabel ]->Text = String::Concat( criteriaLabel, args->Column->AutoSizeMode );
}
// Updated the criteria label.
private void dataGridView_AutoSizeColumnModeChanged(object sender,
    DataGridViewAutoSizeColumnModeEventArgs args)
{
    args.Column.DataGridView.Parent.
        Controls["flowlayoutpanel"].Controls[criteriaLabel].
        Text = criteriaLabel
        + args.Column.AutoSizeMode.ToString();
}
' Updated the criteria label.
Private Sub dataGridView_AutoSizeColumnCriteriaChanged( _
    ByVal sender As Object, _
    ByVal args As DataGridViewAutoSizeColumnModeEventArgs) _
    Handles DataGridView.AutoSizeColumnModeChanged

    args.Column.DataGridView.Parent. _
    Controls("flowlayoutpanel"). _
    Controls(criteriaLabel).Text = _
        criteriaLabel & args.Column.AutoSizeMode.ToString
End Sub

注解

AutoSizeColumnModeChanged 控件DataGridView中的某一列的AutoSizeMode属性值更改时, 将引发该事件。The AutoSizeColumnModeChanged event is raised when the value of the AutoSizeMode property of a column in a DataGridView control changes.

有关如何处理事件的详细信息, 请参阅处理和引发事件For more information about how to handle events, see Handling and Raising Events.

构造函数

DataGridViewAutoSizeColumnModeEventArgs(DataGridViewColumn, DataGridViewAutoSizeColumnMode) DataGridViewAutoSizeColumnModeEventArgs(DataGridViewColumn, DataGridViewAutoSizeColumnMode) DataGridViewAutoSizeColumnModeEventArgs(DataGridViewColumn, DataGridViewAutoSizeColumnMode) DataGridViewAutoSizeColumnModeEventArgs(DataGridViewColumn, DataGridViewAutoSizeColumnMode)

初始化 DataGridViewAutoSizeColumnModeEventArgs 类的新实例。Initializes a new instance of the DataGridViewAutoSizeColumnModeEventArgs class.

属性

Column Column Column Column

获取 AutoSizeMode 属性发生更改的列。Gets the column with the AutoSizeMode property that changed.

PreviousMode PreviousMode PreviousMode PreviousMode

获取列的 AutoSizeMode 属性以前的值。Gets the previous value of the AutoSizeMode property of the column.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

适用于

另请参阅