語言

DataGridViewCellStyle.ApplyStyle(DataGridViewCellStyle) 方法

定義

將指定的 DataGridViewCellStyle 應用於電流 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
Public Overridable Sub ApplyStyle (dataGridViewCellStyle As DataGridViewCellStyle)

參數

dataGridViewCellStyle
DataGridViewCellStyle

該 DataGridViewCellStyle 應用於當前 DataGridViewCellStyle的 。

例外狀況

dataGridViewCellStyle 是 null。

備註

該 ApplyStyle 方法將參數中設定 dataGridViewCellStyle 的屬性值應用於當前 DataGridViewCellStyle。 如果某屬性未設在 dataGridViewCellStyle,電流 DataGridViewCellStyle 會保留該屬性的值。

適用於

另請參閱

  • DataGridView
  • Windows Forms DataGridView 控制項中的儲存格樣式