Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Question about using a color to draw a border

Posted on 2011-09-28
1
Medium Priority
?
272 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 2000 total points
ID: 36716310
Color c =System.Drawing.Color.FromArgb(246,246,246)
or
ColorTranslator.FromOle(RGB(255,255,192))
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

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…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

971 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