【发布时间】:2016-12-25 00:54:00
【问题描述】:
有什么想法吗?我有办法,但只会从下往上改变,菜单在顶部。
【问题讨论】:
-
不是一个明确的问题,没有你到目前为止所做的代码示例,没有以前研究的例子,有点像家庭作业。
-
是的,你可以......现在去阅读
有什么想法吗?我有办法,但只会从下往上改变,菜单在顶部。
【问题讨论】:
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);
}
}
【讨论】: