-3
アイデア?私は道があるが、それは下からしか変わらず、メニューは一番上にある。あなたは色を選択できるようにする機能を作れますか?C#(コンソール)
アイデア?私は道があるが、それは下からしか変わらず、メニューは一番上にある。あなたは色を選択できるようにする機能を作れますか?C#(コンソール)
class Program
{
static void Main(string[] args)
{
Console.WriteLine("input BackgroundColor:");
string bcolor = Console.ReadLine();
Console.WriteLine("input ForegroundColor:");
string fcolor = Console.ReadLine();
ChangeColorConsole(bcolor, fcolor);
Console.Read();
}
static void ChangeColorConsole(string bvalue, string fvalue)
{
Console.BackgroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), bvalue);
Console.Clear();
Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), fvalue);
}
}
BackgroundColorとForegroundColorを一緒に設定する必要があります。クリアコンソール –
これまでに行ったことのないコードサンプル、先行研究の例はなく、kinddaは宿題のように見えます。 – MichaelThePotato
はい、できます。....今すぐに読んでください – BugFinder