private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
dataGridView1.Rows[e.RowIndex].Cells["Column1"].Value = imageList1.Images[0];
}这样显示的图片闪个不停 怎么了?????????????请教
{
dataGridView1.Rows[e.RowIndex].Cells["Column1"].Value = imageList1.Images[0];
}这样显示的图片闪个不停 怎么了?????????????请教
解决方案 »
- 菜鸟求教啊,登录问题啊 。大家都来帮我啊急急急急急急急急急急急急急急急急急急急急急急急急急急急急急急急急
- 有哪位用过DevExpress.XtraScheduler.SchedulerControl控件的
- 有谁能讲解下C#用向导生成的程序吗》?
- 大侠们,如何判断一个是是正整数,负整数,分数?
- 阶乘,如何使用递归传值?!
- C# 程序运行时DLL加载失败
- 如何获取应用程序的参数
- 将多个对象序列化进同一个文件,怎么反序列化出来?
- int bbb=int.Parse("2543.000"); 错误???
- 怎样确定某年某月有多少天?
- 方法传参数问题...等待庖丁解牛
- 怎么样让datagridview框保留原来搜索过的记录
因为你在CellFormatting里改变Value值导致控件刷新,而刷新有要调用CellFormatting。。
应该使用DataGridViewCellFormattingEventArgs.Value=imageList1.Images[0];
事件里面的编程要注意如果EventArgs提供了这样的东西你用这个比较省心。
private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
this.dataGridView1[0, 0].Value = this.imageList1.Images[0];
}
private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
e.Value = this.imageList1.Images[0];
}