private void saveButton_Click(object sender, EventArgs e) { string name = textBox1.Text; DateTime dt = meetDTP.Value; string daystr = textBox2.Text; int day = int.Parse(daystr); bf = new Boyfriend(name, dt, day); }
private void button1_Click(object sender, EventArgs e) { 新建男友 f2 = new 新建男友(); DialogResult dr2 = f2.ShowDialog(); if (dr2 == DialogResult.OK) { Boyfriend bf = f2.BF; bfs[n] = bf; n++; MessageBox.Show("新建成功!"); } }
private void button3_Click(object sender, EventArgs e) { Boyfriend t = new Boyfriend("", DateTime.Now, 0); int j, k, index; for (j = 0; j < n - 1; j++) { index = j; for (k = j + 1; k < n; k++) { if (bfs[k].DT > bfs[index].DT) { index = k; } } t = bfs[index]; bfs[index] = bfs[j]; bfs[j] = t; } 排序输出 f4 = new 排序输出(); DialogResult dr4 = f4.ShowDialog(); }
public 新建男友() { InitializeComponent(); bf = null; }