Hi Partho,
Yes you need to extend NListBoxRenderer.
To change the back color you need to override DrawItemBackground method, and to change the fore color you just need to change Palette.WindowText and Palette.HighlightText.
Here is an example implementation of the DrawItemBackground method:
public override void DrawItemBackground(Graphics g, NListBoxItem item)
{
if (m_List.CurrentSkin != null)
base.DrawItemBackground(g, item);
if (!m_List.Enabled)
return;
if (item.ListBox.SelectedItem == item)
{
base.DrawItemBackground(g, item);
}
else
{
if (m_List.ColumnOnLeft)
{
DrawColumn(g, item);
}
//Here you can use an item.Tag property to provide the desired color instead of the index.
if (item.Index == 1)
{
m_Brush.Color = Color.Red;
}
else
{
m_Brush.Color = m_Palette.Window;
}
g.FillRectangle(m_Brush, m_TextRect);
}
}
Best Regards,
Nevron Support Team