Solved

Question about using a color to draw a border

Posted on 2011-09-28
1
239 Views
Last Modified: 2013-12-17
Hi,

I have this methode that I have put in the code-section.
It works great.

Can this code be changed using this:   (Color.FromArgb(0xC2, 0xC4, 0xCB))

Peter
 
private void StickyNotes_Paint(object sender, PaintEventArgs e)
        {
            string HexColor = "#c2c4cb";
            Color c = System.Drawing.ColorTranslator.FromHtml(HexColor);
            using (Pen pen = new Pen(c, 2))
            {
                e.Graphics.DrawRectangle(pen, this.ClientRectangle);
            }
        }

Open in new window

0
Comment
Question by:peterkiers
1 Comment
 
LVL 9

Accepted Solution

by:
xav056 earned 500 total points
ID: 36716310
Color c =System.Drawing.Color.FromArgb(246,246,246)
or
ColorTranslator.FromOle(RGB(255,255,192))
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

810 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