随笔分类 -  WinForm

摘要:目标:在输入框中输入任何值后,点击“确认”按钮让输出框中输出“Hello!”。主界面:希望在输入框中输入信息后,点击“Enter”键实现点击界面中“确认”的功能。方法:1. 找到TextBox的KeyPressed方法:2.在TextBox的KeyPressed方法体中写: private voi... 阅读全文
posted @ 2013-01-08 19:30 CherishFu 阅读(1714) 评论(0) 推荐(0)
摘要:当DataGridView的DataSource是泛型List,当List的数据改变时,则需要先将DataGridView的DataSource设置为new List(),再将改变后的List赋给DataGridView的DataSource。 但,如果想要直接对绑定在DataGridView中的List进行数据的添加删除,可以先要把List转换成BindingList,再进行绑定,这时BindingList的数据改变时,DataGridView的数据会随之改变,无需重新绑定到DataGridView。 阅读全文
posted @ 2013-01-05 15:30 CherishFu 阅读(15150) 评论(0) 推荐(3)