C#의 ListView를 사용하여 표를 만듭니다. 나는 프로그래밍 방식으로 특정 셀을 강조 할 수있는 방법을 찾고 싶다. 하나의 셀만 강조 표시하면됩니다.C# ListView 세부 정보, 단일 셀 강조 표시
나는 Owner Drawn 하위 항목을 실험했지만 아래 코드를 사용하여 강조 표시된 셀은 있지만 텍스트는 표시되지 않습니다! 이 작업을 수행하는 방법에 대한 아이디어가 있습니까? 당신의 도움을 주셔서 감사합니다.
//m_PC.Location is the X,Y coordinates of the highlighted cell.
void listView1_DrawSubItem(object sender, DrawListViewSubItemEventArgs e)
{
if ((e.ItemIndex == m_PC.Location.Y) && (e.Item.SubItems.IndexOf(e.SubItem) == m_PC.Location.X))
e.SubItem.BackColor = Color.Blue;
else
e.SubItem.BackColor = Color.White;
e.DrawBackground();
e.DrawText();
}
Winforms 또는 web? – tvanfosson