h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Override ToString Method in C#.Net

This is a Example for Override ToString Method in C#.Net

To Create a Class File for Convert a integer into string

        private int idx;
        public Class1(int idxs)
        {
            this.idx = idxs;
        }
        public override string ToString()
        {
            return this.idx.ToString() + " " + "Good";
        }
Paste this following code in your main form
   Class1 cls = new Class1(10);
            MessageBox.Show(cls.ToString());

Output:
10 Good