DataGridViewCellStyle.ApplyStyle(DataGridViewCellStyle) 方法

定义

将指定的 DataGridViewCellStyle 应用于当前 DataGridViewCellStyleApplies the specified DataGridViewCellStyle to the current DataGridViewCellStyle.

public:
 virtual void ApplyStyle(System::Windows::Forms::DataGridViewCellStyle ^ dataGridViewCellStyle);
public virtual void ApplyStyle (System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle);
abstract member ApplyStyle : System.Windows.Forms.DataGridViewCellStyle -> unit
override this.ApplyStyle : System.Windows.Forms.DataGridViewCellStyle -> unit

参数

dataGridViewCellStyle
DataGridViewCellStyle

应用于当前 DataGridViewCellStyleDataGridViewCellStyleThe DataGridViewCellStyle to apply to the current DataGridViewCellStyle.

异常

dataGridViewCellStylenulldataGridViewCellStyle is null.

注解

ApplyStyle 方法将 dataGridViewCellStyle 参数中设置的属性值应用于当前 DataGridViewCellStyleThe ApplyStyle method applies the values of the properties that are set in the dataGridViewCellStyle parameter to the current DataGridViewCellStyle. 如果未在 dataGridViewCellStyle中设置属性,则当前 DataGridViewCellStyle 保留该属性的值。If a property is not set in dataGridViewCellStyle, the current DataGridViewCellStyle retains its value of that property.

适用于

另请参阅