2011-04-30 109 views

回答

1

這可以使用RepositoryItem的DrawItem事件來完成。以下是一些示例代碼:

private void repositoryItemComboBox1_DrawItem(object sender, ListBoxDrawItemEventArgs e) { 
      if(e.State == DrawItemState.None) { 
       e.Appearance.BackColor = e.Index % 2 == 0 ? Color.Green : Color.Red; 
      } 
     }