IDataGridViewEditingControl.ApplyCellStyleToEditingControl Methode

Definitie

Hiermee wijzigt u de gebruikersinterface (UI) van het besturingselement zodat deze consistent is met de opgegeven celstijl.

public:
 void ApplyCellStyleToEditingControl(System::Windows::Forms::DataGridViewCellStyle ^ dataGridViewCellStyle);
public void ApplyCellStyleToEditingControl(System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle);
abstract member ApplyCellStyleToEditingControl : System.Windows.Forms.DataGridViewCellStyle -> unit
Public Sub ApplyCellStyleToEditingControl (dataGridViewCellStyle As DataGridViewCellStyle)

Parameters

dataGridViewCellStyle
DataGridViewCellStyle

Het DataGridViewCellStyle te gebruiken als het model voor de gebruikersinterface.

Voorbeelden

Het volgende codevoorbeeld biedt een implementatie van dit lid. Dit voorbeeld maakt deel uit van een groter voorbeeld dat beschikbaar is in Hoe to: Hostbesturingselementen in Windows Forms DataGridView-cellen.

// Implements the 
// IDataGridViewEditingControl.ApplyCellStyleToEditingControl method.
public void ApplyCellStyleToEditingControl(
    DataGridViewCellStyle dataGridViewCellStyle)
{
    this.Font = dataGridViewCellStyle.Font;
    this.CalendarForeColor = dataGridViewCellStyle.ForeColor;
    this.CalendarMonthBackground = dataGridViewCellStyle.BackColor;
}
Public Sub ApplyCellStyleToEditingControl(ByVal dataGridViewCellStyle As _
    DataGridViewCellStyle) _
    Implements IDataGridViewEditingControl.ApplyCellStyleToEditingControl

    Me.Font = dataGridViewCellStyle.Font
    Me.CalendarForeColor = dataGridViewCellStyle.ForeColor
    Me.CalendarMonthBackground = dataGridViewCellStyle.BackColor

End Sub

Opmerkingen

Normaal gesproken stelt een implementatie van deze methode ui-eigenschappen in voor het bewerkingsbesturingselement, zoals lettertype, achtergrondkleur en voorgrondkleur, op de waarden van de bijbehorende eigenschappen in de dataGridViewCellStyle, wat de stijl is die wordt gebruikt voor de cel die als host fungeert voor het besturingselement.

Van toepassing op

Zie ook