2017-01-18 69 views
0

我的代碼是:Style.ForeColor未在Windows正常工作7

grdListofItems.Rows[intRow].Cells[columnName].Style.ForeColor = Color.Green; 

它工作正常,在Windows經典模式DropDownList字體爲綠色。
但是,當它在Windows 7中運行時,字體顏色會變回黑色。

+0

@ zx485感謝的人 –

回答

0

嘗試啓用Application.EnableVisualStyles();。 順便說一下,你的意思是一個ComboBoxDataGridView

編輯:此鏈接導致答案。 Change the back color of the cell for DataGridViewComboBoxColumn

+0

它仍然是相同的人.. –

+0

如果它是一個組合框:http://stackoverflow.com/questions/4667532/colour-individual-items-in-a-winforms-combobox 如果這是一個DataGridView:我試了一下,它的工作原理... – Essigwurst

+0

DataGridViewComboBoxColumn –

相關問題