【发布时间】:2015-09-17 09:32:05
【问题描述】:
我想用另一种背景和前景色写一行。直截了当的解决方案也改变了下一行末尾空格的背景,这看起来很糟糕。
Console.BackgroundColor = ConsoleColor.Blue;
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("----------------------CoNet------------------------");
Console.ResetColor();
Console.WriteLine("Akkoord? type: ja of nee: "); // The rest of this line gets blue. Why?
第一行是蓝底白字,没关系。第二行应该是黑底灰(默认),但其内容右侧的可用空间都是蓝色的。
这怎么可能?我做错了什么?
【问题讨论】:
-
It doesn't happen on my computer。也许您的
BackgroundColor的默认颜色是已经蓝色?
标签: c# colors console console.writeline