Re: Listbox with colors as items

Discussion in 'ASP .Net' started by Ken Cox [Microsoft MVP], May 14, 2004.

  1. Hi Harald,

    Was it that you are trying to fill the listbox with the available colours?

    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 New ListItem
    Dim enumColor As New KnownColor
    Dim Colors As Array = _
    [Enum].GetValues(enumColor.GetType())
    ListBox1.DataSource = Colors
    ListBox1.DataBind()
    strSelectedColor = ListBox1.Items(0).Text
    End If
    End Sub

    "Harald" <> wrote in message
    news:...
    > Hello
    >
    > I need to use a listbox with the possibility to select a color as an item
    > like
    > we use it for fore/background colors in the dev environment.
    >
    > Any help would be very appreciated
    >
    > Thanks
    >
     
    Ken Cox [Microsoft MVP], May 14, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kent
    Replies:
    1
    Views:
    909
    Andrew de la Harpe
    May 3, 2004
  2. Replies:
    6
    Views:
    621
    Hendrik van Rooyen
    May 31, 2007
  3. AAaron123

    TreeNode colors come from anchor colors

    AAaron123, Aug 7, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    561
    darrel
    Aug 7, 2008
  4. Replies:
    2
    Views:
    1,191
    Göran Andersson
    Oct 18, 2008
  5. ZelluX
    Replies:
    3
    Views:
    1,960
    Peter Otten
    Dec 1, 2008
Loading...

Share This Page