优化Setting.cs文件中的对象初始化语句,使用对象初始化器语法
This commit is contained in:
@@ -85,19 +85,23 @@ namespace JoyD.Windows.CS
|
||||
private void InitializeTempDiffDataGridView()
|
||||
{
|
||||
// 添加列:温差值
|
||||
DataGridViewTextBoxColumn columnTempDiff = new DataGridViewTextBoxColumn();
|
||||
columnTempDiff.Name = "tempDiffValue";
|
||||
columnTempDiff.HeaderText = "温差值";
|
||||
columnTempDiff.Width = 80;
|
||||
columnTempDiff.ReadOnly = false;
|
||||
DataGridViewTextBoxColumn columnTempDiff = new DataGridViewTextBoxColumn
|
||||
{
|
||||
Name = "tempDiffValue",
|
||||
HeaderText = "温差值",
|
||||
Width = 80,
|
||||
ReadOnly = false
|
||||
};
|
||||
|
||||
// 添加列:颜色
|
||||
DataGridViewButtonColumn columnColor = new DataGridViewButtonColumn();
|
||||
columnColor.Name = "colorColumn";
|
||||
columnColor.HeaderText = "颜色";
|
||||
columnColor.Width = 80;
|
||||
columnColor.Text = "选择";
|
||||
columnColor.UseColumnTextForButtonValue = true;
|
||||
DataGridViewButtonColumn columnColor = new DataGridViewButtonColumn
|
||||
{
|
||||
Name = "colorColumn",
|
||||
HeaderText = "颜色",
|
||||
Width = 80,
|
||||
Text = "选择",
|
||||
UseColumnTextForButtonValue = true
|
||||
};
|
||||
|
||||
// 添加列到DataGridView
|
||||
dataGridViewTempDiff.Columns.Clear();
|
||||
|
||||
Reference in New Issue
Block a user