怎么用C语言制作有色文本框

来源:百度知道 编辑:UC知道 时间:2024/05/29 00:51:06

window()
testattr(128+yellow+6(green<<4));语句会出现yellow与green未定义.
头文件已包含了(conio.h)
该怎么修改?

conio.h中明确了颜色值。
应当是全部大写YELLOW

下面是conio.h中相关内容。

enum COLORS {
BLACK, /* dark colors */
BLUE,
GREEN,
CYAN,
RED,
MAGENTA,
BROWN,
LIGHTGRAY,
DARKGRAY, /* light colors */
LIGHTBLUE,
LIGHTGREEN,
LIGHTCYAN,
LIGHTRED,
LIGHTMAGENTA,
YELLOW,
WHITE
};

参考文献:
函数名: textcolor
功 能: 在文本模式中选择新的字符颜色
用 法: void textcolor(int color);
程序例:
#include <conio.h>
int main(void)
{
int i;
for (i=0; i<15; i++)
{
textcolor(i);
cprintf("Foreground Color\r\n");
}
return 0;
}

函数名: textbackground
功 能: 选择新的文本背景颜色
用 法: void textbackground(int color);
程序例:
#include <conio.h>
int main(void)
{
int i, j;
clrscr();
for (i=0; i<9; i++)
{
for (j=0; j<80; j++)