Results 1 to 5 of 5

Thread: [RESOLVED] VB.Net:How to add all colors in listbox

  1. #1

    Thread Starter
    Lively Member softkans's Avatar
    Join Date
    May 2006
    Posts
    70

    Resolved [RESOLVED] VB.Net:How to add all colors in listbox

    hi can anybody do for me.

    How to add all colors in dotnet color library in a listbox?

    for example a listbox has

    red
    green
    blue
    yellow
    ...
    ..


    how to read from the dotnet library?

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: VB.Net:How to add all colors in listbox

    Goto Quantum Software ... get their Windows Forms Components ... it includes a Color drop down that you can use.... and it's free!

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Lively Member softkans's Avatar
    Join Date
    May 2006
    Posts
    70

    Re: VB.Net:How to add all colors in listbox

    hi
    i need the all colors in a array...
    for example when we type "color. " then it shows all supported colors in dropdown list.
    i want to store all of them into an array or a listbox

  4. #4
    New Member
    Join Date
    Jun 2006
    Posts
    2

    Talking Re: VB.Net:How to add all colors in listbox

    hi softkans,

    try this

    At the top
    Imports System.Reflection

    and then ...

    Dim properties As PropertyInfo() = GetType(System.Drawing.Color).GetProperties(BindingFlags.Static Or BindingFlags.Public)

    Dim color As PropertyInfo
    For Each color In properties
    ListBox1.Items.Add(color.Name)
    Next

    please RESOLVED this post if u got the result

  5. #5

    Thread Starter
    Lively Member softkans's Avatar
    Join Date
    May 2006
    Posts
    70

    Re: VB.Net:How to add all colors in listbox

    Quote Originally Posted by raibow
    hi softkans,

    try this

    At the top
    Imports System.Reflection

    and then ...

    Dim properties As PropertyInfo() = GetType(System.Drawing.Color).GetProperties(BindingFlags.Static Or BindingFlags.Public)

    Dim color As PropertyInfo
    For Each color In properties
    ListBox1.Items.Add(color.Name)
    Next

    please RESOLVED this post if u got the result


    ok raibow.. thanks


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width