DataGridView.AutoSizeColumnModeChanged DataGridView.AutoSizeColumnModeChanged DataGridView.AutoSizeColumnModeChanged DataGridView.AutoSizeColumnModeChanged Event

정의

열의 AutoSizeMode 속성 값이 변경될 때 발생합니다.Occurs when the value of the AutoSizeMode property of a column changes.

public:
 event System::Windows::Forms::DataGridViewAutoSizeColumnModeEventHandler ^ AutoSizeColumnModeChanged;
public event System.Windows.Forms.DataGridViewAutoSizeColumnModeEventHandler AutoSizeColumnModeChanged;
member this.AutoSizeColumnModeChanged : System.Windows.Forms.DataGridViewAutoSizeColumnModeEventHandler 
Public Custom Event AutoSizeColumnModeChanged As DataGridViewAutoSizeColumnModeEventHandler 

예제

다음 코드 예제에서는이 이벤트의 사용을 보여 줍니다.The following code example illustrates the use of this event. 이 예제는에서 사용할 수 있는 보다 큰 예제의 일부 방법: Windows Forms 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

설명

이벤트를 처리 하는 방법에 대 한 자세한 내용은 참조 하세요. 이벤트 처리 및 발생합니다.For more information about how to handle events, see Handling and Raising Events.

적용 대상

추가 정보