I am new to StackOverflow, something may not be correct in this post.
I have the following sample code to describe my question:
using System;
sealed public class Program
{
public static void Main(string[] args)
{
Console.BackgroundColor = ConsoleColor.Red;
Console.ForegroundColor = ConsoleColor.Yellow;
Console.Write("F");
Console.ResetColor();
Console.BackgroundColor = ConsoleColor.Gray;
Console.ForegroundColor = ConsoleColor.Black;
Console.Write("ile - ");
Console.BackgroundColor = ConsoleColor.Red;
Console.ForegroundColor = ConsoleColor.Yellow;
Console.Write("E");
Console.ResetColor();
Console.BackgroundColor = ConsoleColor.Gray;
Console.ForegroundColor = ConsoleColor.Black;
Console.Write("dit - ");
Console.BackgroundColor = ConsoleColor.Red;
Console.ForegroundColor = ConsoleColor.Yellow;
Console.Write("C");
Console.ResetColor();
Console.BackgroundColor = ConsoleColor.Gray;
Console.ForegroundColor = ConsoleColor.Black;
Console.WriteLine("lose");
Console.ResetColor();
Console.BackgroundColor = ConsoleColor.Blue;
Console.ForegroundColor = ConsoleColor.Black;
Console.WriteLine("- - - - - - - - - - - - - - - - - - - - - - -");
Console.WriteLine("This is just some sample code.");
Console.WriteLine("Now I will generate a little box that requires a hover effect.");
Console.WriteLine("Basically I want its color to be changed to red upon hovering on it, or better - triggering some function.");
Console.WriteLine("I don't think this is possible with console application, but just asking in case if it is still possible.");
Console.BackgroundColor = ConsoleColor.Gray;
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine("###################################");
Console.WriteLine("###################################");
Console.WriteLine("###################################");
Console.WriteLine("###################################");
Console.WriteLine("###################################");
Console.WriteLine("###################################");
Console.WriteLine("###################################");
Console.WriteLine("###################################");
Console.WriteLine("###################################");
Console.WriteLine("###################################");
Console.WriteLine("###################################");
}
}
This little sample-code will generate some text and a gray box. Now, when a user puts their mouse pointer over a gray box, I'd like the gray box to change its color to red, or anything similar - such as detecting it and doing specific operation, mainly triggering a function. I don't think this is possible with C# Console Application, but just asking in case if it is still possible.
Thanks in advance. :)
I tried adding some kind of function, while loop, or adding DLL reference (using .NET Framework csc.exe feature). I quickly got confused and got no idea how to do this.