Results 1 to 5 of 5

Thread: [RESOLVED] converting string to color

  1. #1

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Resolved [RESOLVED] converting string to color

    Hi,
    It is posible to convert string to System.drawing.Color
    ex.

    "Red" = converto System.drawing.Color


    Thanks,
    Popskie

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: converting string to color

    I've said it before (a large number of times) and I'll say it again: read the documentation for the type and its member listing first. Had you done that you would have seen the FromName method straight off. If I can find it, which I just did by following my own advice, then you can too.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: [RESOLVED] converting string to color

    Sory JM I dont have any rosources even msdn. thanks
    I just keep on surfing on the web but not lucky.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [RESOLVED] converting string to color

    If you have access to this forum then you have access to the online MSDN library. The link below is the result of a search for "color members", which is how you should search for the member listing for a class or structure. The first two results are for the type overview and member listing from the .NET 1.1 documentation and the next two are the same topics from the .NET 2.0 documentation. You would follow the link to the member listing for the appropriate version and just look down the list of members to see if the name and description of one jumps out as useful. The FromName method is described thusly:
    Creates a Color structure from the specified name of a pre-defined color.
    That sounds useful so you'd follow the link to the more detailed topic about that method, where you'll often get a code sample too.

    http://search.msdn.microsoft.com/sea...=color+members
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: [RESOLVED] converting string to color

    thanks for the link jm. its very useful to me.

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