永发信息网

哪位愿意帮我把vc++程序加个背景色。

答案:2  悬赏:0  手机版
解决时间 2021-02-27 10:23
  • 提问者网友:爱唱彩虹
  • 2021-02-26 21:30
程序其他不用变动.
愿意帮我的话,百度hi我.
最佳答案
  • 五星知识达人网友:不如潦草
  • 2021-02-26 23:08
可以按这个例子来改
#include
int main()
{
system("color DE");//字体颜色为黄色,背景为粉色
system("pause");
return 0;
}

下面是帮助

C:\Documents and Settings\Michael>color /?
Sets the default console foreground and background colors.

COLOR [attr]

attr Specifies color attribute of console output

Color attributes are specified by TWO hex digits -- the first
corresponds to the background; the second the foreground. Each digit
can be any of the following values:

0 = Black 8 = Gray
1 = Blue 9 = Light Blue
2 = Green A = Light Green
3 = Aqua B = Light Aqua
4 = Red C = Light Red
5 = Purple D = Light Purple
6 = Yellow E = Light Yellow
7 = White F = Bright White

If no argument is given, this command restores the color to what it was
when CMD.EXE started. This value either comes from the current console
window, the /T command line switch or from the DefaultColor registry
value.

The COLOR command sets ERRORLEVEL to 1 if an attempt is made to execute
the COLOR command with a foreground and background color that are the
same.

Example: "COLOR fc" produces light red on bright white
全部回答
  • 1楼网友:人類模型
  • 2021-02-26 23:37
发过来看看
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯