📄 kmeanssettingform.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace SimpleKMeans.Demo
{
public partial class KMeansSettingForm : Form
{
public int K { get; set; }
public double Precise { get; set; }
private int _times = -1;
public int Times
{
get
{
return this._times;
}
set
{
this.checkBox1.Checked = !(Convert.ToInt32(value) == -1);
this._times = value;
}
}
public KMeansSettingForm(int k, double precise, int times)
{
InitializeComponent();
this.txtK.Text = k.ToString();
this.txtPrecise.Text = precise.ToString();
if (times == -1)
{
this.txtTimes.Enabled = false;
this.checkBox1.Checked = false;
}
else
{
this.txtTimes.Text = times.ToString();
this.checkBox1.Checked = false;
this.txtTimes.Enabled = true;
}
}
private void button1_Click(object sender, EventArgs e)
{
this.K = Convert.ToInt32(this.txtK.Text);
this.Precise = Convert.ToDouble(this.txtPrecise.Text);
if (this.checkBox1.Checked)
{
this.Times = Convert.ToInt32(this.txtTimes.Text);
}
else
{
this.Times = -1;
}
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
this.txtTimes.Enabled = this.checkBox1.Checked;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -