Pages

Wednesday, November 21, 2007

Creating a new Class

Create a new winforms project, then right-click the project and do this:

Create a new Class object

Add this code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClassDemo
{
    class newClass
    {
        public string sharedString = "This can be read and written by anyone.";
        private string myString = "Only visible in newClass.";


    }
}

And then right-click and add a 'ctor' (constructor) snippet as shown.

No comments:

Share This!

Contact Us

Name

Email *

Message *