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