DataGridViewAutoSizeModeEventHandler DataGridViewAutoSizeModeEventHandler DataGridViewAutoSizeModeEventHandler DataGridViewAutoSizeModeEventHandler Delegate

정의

AutoSizeRowsModeChangedRowHeadersWidthSizeModeChanged 또는 DataGridView 이벤트를 처리하는 메서드를 나타냅니다.Represents the method that will handle the AutoSizeRowsModeChanged or RowHeadersWidthSizeModeChanged events of a DataGridView.

public delegate void DataGridViewAutoSizeModeEventHandler(System::Object ^ sender, DataGridViewAutoSizeModeEventArgs ^ e);
public delegate void DataGridViewAutoSizeModeEventHandler(object sender, DataGridViewAutoSizeModeEventArgs e);
type DataGridViewAutoSizeModeEventHandler = delegate of obj * DataGridViewAutoSizeModeEventArgs -> unit
Public Delegate Sub DataGridViewAutoSizeModeEventHandler(sender As Object, e As DataGridViewAutoSizeModeEventArgs)

매개 변수

sender
Object Object Object Object

이벤트 소스입니다.The source of the event.

상속
DataGridViewAutoSizeModeEventHandlerDataGridViewAutoSizeModeEventHandlerDataGridViewAutoSizeModeEventHandlerDataGridViewAutoSizeModeEventHandler

예제

다음 코드를 처리 하는 방법에 설명 합니다 AutoSizeRowsModeChanged 이벤트입니다.The following code demonstrates how to handle the AutoSizeRowsModeChanged event.

void WatchRowsModeChanges( Object^ /*sender*/, DataGridViewAutoSizeModeEventArgs^ modeEvent )
{
   Label^ label = dynamic_cast<Label^>(flowLayoutPanel1->Controls[ currentLayoutName ]);
   if ( modeEvent->PreviousModeAutoSized )
   {
      label->Text = String::Format( "changed to a different {0}{1}", label->Name, dataGridView1->AutoSizeRowsMode );
   }
   else
   {
      label->Text = String::Concat( label->Name, dataGridView1->AutoSizeRowsMode );
   }
}


private void WatchRowsModeChanges(object sender,
    DataGridViewAutoSizeModeEventArgs modeEvent)
{
    Label label =
        (Label)flowLayoutPanel1.Controls[currentLayoutName];

    if (modeEvent.PreviousModeAutoSized)
    {
        label.Text = "changed to a different " +
            label.Name +
            dataGridView1.AutoSizeRowsMode.ToString();
    }
    else
    {
        label.Text = label.Name +
            dataGridView1.AutoSizeRowsMode.ToString();
    }
}
Private Sub WatchRowsModeChanges(ByVal sender As Object, _
    ByVal modeEvent As DataGridViewAutoSizeModeEventArgs) _
    Handles DataGridView1.AutoSizeRowsModeChanged

    Dim label As Label = CType(FlowLayoutPanel1.Controls _
        (currentLayoutName), Label)

    If modeEvent.PreviousModeAutoSized Then
        label.Text = "changed to different " & label.Name & _
            DataGridView1.AutoSizeRowsMode.ToString()
    Else
        label.Text = label.Name & _
            DataGridView1.AutoSizeRowsMode.ToString()
    End If
End Sub

설명

AutoSizeRowsModeChanged 이벤트가 발생 때 값을 AutoSizeRowsMode 의 속성을 DataGridView 컨트롤이 변경 합니다.The AutoSizeRowsModeChanged event is raised when the value of the AutoSizeRowsMode property of the DataGridView control changes. RowHeadersWidthSizeModeChanged 이벤트는 때의 값을 RowHeadersWidthSizeMode 속성 변경.The RowHeadersWidthSizeModeChanged event is raised when the value of the RowHeadersWidthSizeMode property changes.

DataGridViewAutoSizeModeEventHandler 대리자를 만들 때, 이벤트를 처리할 메서드를 식별합니다.When you create a DataGridViewAutoSizeModeEventHandler delegate, you identify the method that will handle the event. 이벤트를 이벤트 처리기와 연결하려면 대리자의 인스턴스를 해당 이벤트에 추가합니다.To associate the event with your event handler, add an instance of the delegate to the event. 대리자를 제거하지 않는 경우 이벤트가 발생할 때마다 이벤트 처리기가 호출됩니다.The event handler is called whenever the event occurs, unless you remove the delegate. 이벤트 처리기 대리자에 대 한 자세한 내용은 이벤트 처리기 대리자에 대 한 자세한 내용은 이벤트 처리 및 발생합니다.For more information about event-handler delegates, information about event-handler delegates, see Handling and Raising Events.

확장 메서드

GetMethodInfo(Delegate) GetMethodInfo(Delegate) GetMethodInfo(Delegate) GetMethodInfo(Delegate)

지정된 대리자가 나타내는 메서드를 나타내는 개체를 가져옵니다.Gets an object that represents the method represented by the specified delegate.

적용 대상

추가 정보