简体   繁体   English

WPF:值不同时更改GridView单元格颜色几秒钟

[英]WPF: Change GridView cell colors few second when differ in values

When the gridview cell's value change, I want to change the background color for few seconds to notify users. 当gridview单元格的值更改时,我想更改背景颜色几秒钟以通知用户。 How to implement. 如何实施。 I can change the background color when the value is changed. 当值更改时,我可以更改背景色。 But I don't know how to change it back after few seconds. 但我不知道如何在几秒钟后将其改回。

I think you can use a timer in the cell change event handler, and set the background color twice. 我认为您可以在单元格更改事件处理程序中使用计时器,并两次设置背景色。 Once the highlighting color and at the end of timer, normal background color. 一旦突出显示颜色并在计时器结束时显示正常的背景颜色。

Here's a full impementation of CellValueChanged on DataGriewView. 这是DataGriewView上CellValueChanged的完整实现。 Check this out once. 检查一次。

https://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellvaluechanged(v=vs.110).aspx https://msdn.microsoft.com/zh-CN/library/system.windows.forms.datagridview.cellvaluechanged(v=vs.110).aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM