Click here to Skip to main content
15,895,799 members
Articles / Programming Languages / XML

Is Code Complete?

Rate me:
Please Sign up or sign in to vote.
4.86/5 (77 votes)
11 Nov 2018CPOL9 min read 106.7K   357   221  
Design principles to be followed in software development
using System.Windows.Forms;
using System.Drawing;

namespace OCP
{
    class Square : IShapes
    {
        #region IShapes Members
        /// <summary>
        /// 
        /// </summary>
        /// <param name="frm"></param>
        public void DrawShapes(Form frm)
        {
            Graphics grph = frm.CreateGraphics();

            //Fill the background with violet color
            grph.Clear(Color.Violet);

            System.Drawing.Rectangle rect = frm.ClientRectangle;

            rect.Height -= 50;
            rect.Width = rect.Height;

            //To Draw Square
            grph.FillRectangle(new SolidBrush(Color.Green), 20, 20, 
                                rect.Width, rect.Height);

            //To Draw string
            grph.DrawString("Square", new Font("Arial", 20), 
                            new SolidBrush(Color.WhiteSmoke), 50, 50);
        }

        #endregion
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions