kmeanssettingform.cs
来自「K-Means C++实现 带演示程序 K-Means C++实现 带演示程序」· CS 代码 · 共 73 行
CS
73 行
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 + =
减小字号Ctrl + -
显示快捷键?