All pastes #2107537 Raw Edit

Mine

public text v1 · immutable
#2107537 ·published 2012-01-29 20:05 UTC
rendered paste body
//
//  KONSOLDA RENKLİ MENÜ UYGULAMASI
//
//Bu program 29.01.2012 Tarihinde
//Hüseyin Çakanlı Tarafından
//Örnek Olarak Yazıldı.
//Visual Strudio 2010 tarafından test edilmiştir.

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int i = 1;
            int MenuNo = 1;
        
            
            do
            {

                Console.CursorVisible = false;
                Console.BackgroundColor = ConsoleColor.Black;
                Console.Clear();


                if (i == 1) 
                    { 
                       Console.BackgroundColor = ConsoleColor.Red;
                       Console.WriteLine("      1.Menü Seçeneği     ");
                    } else 
                    { 
                      Console.BackgroundColor = ConsoleColor.White; 
                      Console.WriteLine("      1.Menü Seçeneği     ");
                    }
                if (i == 2) 
                    { 
                       Console.BackgroundColor = ConsoleColor.Red;
                       Console.WriteLine("      2.Menü Seçeneği     ");
                    } else 
                    { 
                      Console.BackgroundColor = ConsoleColor.White; 
                      Console.WriteLine("      2.Menü Seçeneği     ");
                    }
                if (i == 3) 
                    { 
                       Console.BackgroundColor = ConsoleColor.Red;
                       Console.WriteLine("      3.Menü Seçeneği     ");
                    } else 
                    { 
                      Console.BackgroundColor = ConsoleColor.White; 
                      Console.WriteLine("      3.Menü Seçeneği     ");
                    }
                if (i == 4) 
                    { 
                       Console.BackgroundColor = ConsoleColor.Red;
                       Console.WriteLine("      4.Menü Seçeneği     ");
                    } else 
                    { 
                      Console.BackgroundColor = ConsoleColor.White; 
                      Console.WriteLine("      4.Menü Seçeneği     ");
                    }
                if (i == 5) 
                    { 
                       Console.BackgroundColor = ConsoleColor.Red;
                       Console.WriteLine("      5.Menü Seçeneği     ");
                    } else 
                    { 
                      Console.BackgroundColor = ConsoleColor.White; 
                      Console.WriteLine("      5.Menü Seçeneği     ");
                    }

                if (i == 6) 
                    { 
                       Console.BackgroundColor = ConsoleColor.Red;
                       Console.WriteLine("      6.Çıkış             ");
                    } else 
                    { 
                      Console.BackgroundColor = ConsoleColor.White; 
                       Console.WriteLine("      6.Çıkış             ");
                    }
                
                    MenuNo = i;

                    Console.BackgroundColor = ConsoleColor.Yellow; 
                    Console.WriteLine();
                    Console.WriteLine(" Giriş için Enter'e basınız.");

                    //Klavyeden bir tusa basılmasını bekle.
                    System.ConsoleKeyInfo Tus = Console.ReadKey(true);

                    //Enter Tusununa basildi ise giris yap
                    if (Tus.Key.ToString() == "Enter") i = -1; 
 
                    //Yukarı tusuna basildi ise aktif secenek bir uste
                    if (Tus.Key.ToString() == "UpArrow") i--;

                    //Asagi tusuna basildi ise aktif secenek bir uste
                    if (Tus.Key.ToString() == "DownArrow") i++;

                    if (i == 0) i = 6;
                    if (i == 7) i = 1;

            } while (i != -1);

            Console.BackgroundColor = ConsoleColor.Black;
            Console.Clear();
            Console.WriteLine("{0} Nolu Menüyü Seçtiniz....",MenuNo);
            Console.ReadLine();
        }
    }
}