更改datagridview前景色 [英] change datagridview foreground color

查看:118
本文介绍了更改datagridview前景色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们,新问题:

i在我的wpf窗口中有2个datagridview:DgIncome和DgOutcome。

DgIncome前景设置为绿色并且DgOutcome前景设置为两个datagridviews上的红色。

,当我点击其中一行时,单元格前景变为白色,那就好了。

是什么问题?假设我点击了DgIncome中的一个项目,该行现在是白色的。现在,我去DgOutcome点击它。结果:DgIncome中的项目不会返回其原始颜色,绿色,但会变为黑色。它是双向的。

我尝试解决它抛出< style>或datagridview属性,但没有成功。

任何代码都有用...

谢谢,

oron。

hey guys, new problem:
i have 2 datagridview in my wpf window: DgIncome and DgOutcome.
the DgIncome foreground is set to green and the DgOutcome foreground is set to red.
on both datagridviews, when i click one of the rows, the cell foreground changes to white and that ok.
whats the problem? assuming i clicked one item in the DgIncome, the row is now white. now, i go to the DgOutcome and click it. the result: the item in the DgIncome does not return to its original color, Green, but changes to black. it goes both ways.
i tryed solving it threw the <style> or the datagridview properties but with zero success.
any code would be usefull...
thanks,
oron.

推荐答案

Private Sub DgOutcome_SelectionChanged(sender As Object,e As SelectionChangedEventArgs)Handle DgOutcome.SelectionChanged

DgIncome.UnselectAll()

End Sub
Private Sub DgOutcome_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles DgOutcome.SelectionChanged
DgIncome.UnselectAll()
End Sub


这篇关于更改datagridview前景色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆