Datagridview单元格背景颜色? [英] Datagridview cell background color?
问题描述
有没有办法在未绑定的数据网格视图中更改
单个单元格的前景色或背景色?
< blockquote> dgk写道:
有没有办法在未绑定的datagridview中更改
单个单元格的前景色或背景色?
使用样式属性 -
DataGridView1.Item(ColumnIndex,RowIndex).Style.BackColor = Color
DataGridView1.Item(ColumnIndex,RowIndex).Style.ForeColor = Color
或
DataGridView1.CurrentCell.Style.BackColor = Color
DataGridView1.CurrentCell.Style.ForeColor =颜色
希望这能回答你的问题。
ShaneO
有10种人 - 那些懂的人二元和那些
不要。
DGK,
AFAIK你可以当a。从普通文本框中,你可以不为文本框背景的背景着色
。这些都没有任何背景。
您可以更改边框。
这是我们网站上的示例。
http:// www.vb-tips.com/default.aspx?...4-5967be300f0a
我希望这会有所帮助,
Cor
" dgk" <否***** @ MailsAnonymous.com> schreef在bericht
新闻:aj ******************************** @ 4ax.com ...有没有办法在未绑定的数据网格视图中更改
单个单元格的前景色或背景色?
>
2006年4月10日星期一10:08:48 +1000,ShaneO< sh ****** @ optusnet.com.au>
写道:
< blockquote class =post_quotes> dgk写道:有没有办法在未绑定的datagridview中更改
单个单元格的前景色或背景色?
使用样式 DataGridView1.Item(ColumnIndex,RowIndex).Style.BackColor = Color
DataGridView1.Item(ColumnIndex,RowIndex).Style.ForeColor = Color
或者DataGridView1.CurrentCell.Style.BackColor = Color
DataGridView1.CurrentCell.Style.ForeColor = Color
希望这能回答你的问题。
< ShaneO
有10种人 - 那些了解Binary的人和那些不知道的人。
是的,这很有效,谢谢。惊人的发现有多难。
Is there a way to change the foreground or background color of a
single cell in an unbound datagridview?
dgk wrote:Is there a way to change the foreground or background color of a
single cell in an unbound datagridview?
Use the "Style" property -
DataGridView1.Item(ColumnIndex, RowIndex).Style.BackColor = Color
DataGridView1.Item(ColumnIndex, RowIndex).Style.ForeColor = Color
or
DataGridView1.CurrentCell.Style.BackColor = Color
DataGridView1.CurrentCell.Style.ForeColor = Color
Hope this answers your question.
ShaneO
There are 10 kinds of people - Those who understand Binary and those who
don''t.
DGK,
AFAIK can you as a from a normal textbox, can you not colour the background
of a textbox backgroud. There is no background at all in those.
You can change the borders.
Here a sample from that on our website.
http://www.vb-tips.com/default.aspx?...4-5967be300f0a
I hope this helps,
Cor
"dgk" <No*****@MailsAnonymous.com> schreef in bericht
news:aj********************************@4ax.com...Is there a way to change the foreground or background color of a
single cell in an unbound datagridview?
On Mon, 10 Apr 2006 10:08:48 +1000, ShaneO <sh******@optusnet.com.au>
wrote:
dgk wrote:Is there a way to change the foreground or background color of a
single cell in an unbound datagridview?
Use the "Style" property -
DataGridView1.Item(ColumnIndex, RowIndex).Style.BackColor = Color
DataGridView1.Item(ColumnIndex, RowIndex).Style.ForeColor = Color
or
DataGridView1.CurrentCell.Style.BackColor = Color
DataGridView1.CurrentCell.Style.ForeColor = Color
Hope this answers your question.
ShaneO
There are 10 kinds of people - Those who understand Binary and those who
don''t.
Yes, that works, thanks. Amazing how hard that is to find.
这篇关于Datagridview单元格背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!