C# Progress Bar coding exception

I was looking to add a percentage to my progress bar and was sent this link:
http://csharphelper.com/blog/2016/07/display-text-progressbar-c/

All is fine with the code below with the exception of

            e.Graphics.TextRenderingHint =
                TextRenderingHint.AntiAliasGridFit;

I get the message "The name 'TextRenderingHint' does not exist in the current context  

How do I correct this?

=============================================================================================================================

        private void pictureBox1_Paint(object sender, PaintEventArgs e)
        {
            // Clear the background.
            e.Graphics.Clear(pictureBox1.BackColor);

            // Draw the progress bar.
            float fraction =
                (float)(ProgressValue - ProgressMinimum) /
                (ProgressMaximum - ProgressMinimum);
            int wid = (int)(fraction * pictureBox1.ClientSize.Width);
            e.Graphics.FillRectangle(
                Brushes.LightGreen, 0, 0, wid,
                pictureBox1.ClientSize.Height);

            // Draw the text.
            e.Graphics.TextRenderingHint =
                TextRenderingHint.AntiAliasGridFit;
            using (StringFormat sf = new StringFormat())
            {
                sf.Alignment = StringAlignment.Center;
                sf.LineAlignment = StringAlignment.Center;
                int percent = (int)(fraction * 100);
                e.Graphics.DrawString(
                    percent.ToString() + "%",
                    this.Font, Brushes.Black,
                    pictureBox1.ClientRectangle, sf);
            }
        }
LVL 1
rwheeler23Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David Johnson, CD, MVPOwnerCommented:
I commented out that line and it didn't seem to affect the program
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AndyAinscowFreelance programmer / ConsultantCommented:
That is a member of the System.Drawing namespace so try adding
using System.Drawing; at the top of the file that class is in
0
rwheeler23Author Commented:
System.Drawing was already there and I did comment it out and tested and it works so I will simply leave it out.
0
rwheeler23Author Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.