Saturday, April 26, 2025

C# OO - Enum and Switch Statement

Program.cs

using System;

namespace LearnCS
{ 
    class Program
    {
        enum Options
        {
            Audio,
            Video,
            Controls
        }
        static void Main(string[] args)
        {
            Options c1 = Options.Controls;
            //Console.WriteLine(c1);

            switch(c1)
            {
                case Options.Audio:
                    Console.WriteLine("Audio Settings");
                    break;
                case Options.Video:
                    Console.WriteLine("Video Settings");
                    break;
                case Options.Controls:
                    Console.WriteLine("Controls");
                    break;
            }

            Console.ReadLine();
        }
    }
}

No comments:

Post a Comment

Tkinter Introduction - Top Widget, Method, Button

First, let's make shure that our tkinter module is working ok with simple  for loop that will spawn 5 instances of blank Tk window .  ...