Hi Giuseppe,
You can set the colour using a style when you set the text. Here's an
example that is fun to watch:
Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
If Not IsPostBack Then
Dim strSelectedColor As String
Dim li As ListItem
Dim lit1 As Literal
Dim lit2 As Literal
Dim enumColor As New KnownColor
Dim Colors As Array = _
[Enum].GetValues(enumColor.GetType())
Dim colour As KnownColor
For Each colour In Colors
li = New ListItem
li.Text = "<SPAN STYLE='color:" & _
colour.ToString & ";'>" & _
colour.ToString & "</SPAN>"
li.Value = colour.ToString
CheckBoxList1.Items.Add(li)
Next
End If
End Sub
<asp:CheckBoxList id="CheckBoxList1" runat="server"></asp:CheckBoxList>
Ken
Microsoft MVP [ASP.NET]