Visual Studio 2005 - Assign BackColor to button using RGB Color

Posted on 2006-04-24
Last Modified: 2008-03-17

I am trying to assign an Excel color as backcolor of a button on a Windows form using the RGB code RGB(45,67,89)
How do I do this?
Question by:murbro
    LVL 62

    Accepted Solution

    Hi murbro;

    Like this:

        Button1.BackColor = System.Drawing.Color.FromArgb(45, 67, 89)


    Author Comment

    Brilliant. Thanks for that
    LVL 62

    Expert Comment

    by:Fernando Soto
    If you are working in C# then it will be:

        button1.BackColor = System.Drawing.Color.FromArgb(45, 67, 89);


        System.Drawing.Color.FromArgb( Red, Green, Blue)

    LVL 62

    Expert Comment

    by:Fernando Soto
    Glad I was able to help. :=)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now