★☆★☆ 再问一个问题: 怎样高亮显示VC中的关键字?

刘小浪 2002-10-23 04:53:17
在VC6.0 IDE 源文件编辑器中,如果输入 int,char等,IDE 会用默认的蓝色高亮显示它. 但VC中的其它关键字如 BOOL,UNIT,TCHAR等只能显示为黑色.怎样让它们跟int,long等关键字一样,也高亮显示成为蓝色呢?
这个问题不会无解吧?分不够再加.
...全文
278 13 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
蓝天 2002-10-25
  • 打赏
  • 举报
回复
谢谢,我也升级为三个三角了。呵呵
蓝天 2002-10-25
  • 打赏
  • 举报
回复
谢谢,我也升级为三个三角了。呵呵
蓝天 2002-10-25
  • 打赏
  • 举报
回复
谢谢,我也升级为三个三角了。呵呵
刘小浪 2002-10-25
  • 打赏
  • 举报
回复
右眼视力0.1, 左眼视力1.0,应该是右眼弱视吧.
高亮显示后看起来爽,用起来爽,想起就爽.
不过我英语不怎么好,还好看得懂一点点.
sky_blue(老衲) 谢谢了,100,不多,请收下.
Rigel 2002-10-23
  • 打赏
  • 举报
回复
同意sky_blue(老衲)的看法,在usertype.dat中加入你想要高亮显示的字就可以了。
cooljjyy 2002-10-23
  • 打赏
  • 举报
回复
没必要吧,难道你要把BYTE LPBYTE LPDIRECTDRAWSURFACE7...都弄成高亮?
li01bin 2002-10-23
  • 打赏
  • 举报
回复
你是弱视?
蓝天 2002-10-23
  • 打赏
  • 举报
回复
可以高亮显示,只不过你要自己写高亮显示的关键字表
比如我的usertype.dat 表中是
BOOL
TRUE
FALSE

三行
现在我工程中的文件中的BOOL,TRUE,FALSE都高亮显示了
qing_li73 2002-10-23
  • 打赏
  • 举报
回复
surely, such as BOOL,UNIT,TCHAR ..they r not keywords ...all Macro
dy_paradise 2002-10-23
  • 打赏
  • 举报
回复
BOOL,UNIT,TCHAR 这些并不是关键字,而是宏,不可以高亮的
蓝天 2002-10-23
  • 打赏
  • 举报
回复
To set syntax coloring for user-defined keywords

In the same directory as msdev.exe, use the Text editor or Windows Notepad to create a text-only file named usertype.dat.


Add your keywords to usertype.dat, one keyword per line.
Note The usertype.dat file is read during initialization. It cannot be renamed, nor can it be reloaded during an editing session. The syntax coloring mechanism checks the usertype.dat file last. Thus, all previously defined color settings take precedence over the user-defined keywords.

Save the file as a text-only file, exit, and then restart Visual Studio.


From the Tools menu, choose Options.


Select the Format tab.


In the Colors box, select User Defined Keywords.


Set the font, font size, foreground color, and background color to your preferences.
For more information, see To change colors used in syntax coloring.

Click OK.
Tip For any source file, you can use the Source File Properties page to specify which language syntax coloring to apply (or turn off syntax coloring altogether). For more information, see Setting Font Style, Size, and Color.

wuxuan 2002-10-23
  • 打赏
  • 举报
回复
BOOL,UNIT,TCHAR是一个宏代换,不是一个关键字,不能进行高亮显示。
只有bool,int,char等关键字才能高亮显示。

breezeofveldt 2002-10-23
  • 打赏
  • 举报
回复
在VC的菜单“工具/选择”中打开“格式”一项,在内面可以实现字体、颜色等许多设置。

15,980

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧