C#机房重构小知识点

1.this.Hide();
隐藏窗体,只是看不到窗体了,并没有关闭。this.Hide()隐藏窗体后还可用 this.Show()重新显示其,而且 Hide 一旦执行不能被中止。
2. this.Close();
close关闭了不表示应用程序退出,而是窗口自身关闭。close执行中是可以被终止的。
3. System.Environment.Exit(0);
系统退出,正在执行的全部终止。
4.禁止自动生成列

DataGrilView.AutoGenerateColumns = false;

5.ListBox控件的应用

listBox1.Items.Clear();//清空
listBox1.Items.Add(Convert.ToString(txtsuggestion.text));//添加数据

猜你喜欢

转载自blog.csdn.net/dingmengwei/article/details/108329829