Solved

Question about using a color to draw a border

Posted on 2011-09-28
1
241 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 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