Visual Studio

【VisualStudio】任意キーワード(Int32など)に色を付ける

VisualStudioを使っていると、int doubleの文字は青く表示されますが、これを.NETっぽくInt32Doubleなどと書くと、色が付いてくれないので、ちょっと見づらくなります。

 

しかし、これらの任意の文字列に色を付けて表示する方法があります。

 

その方法は、

  1. 色を付けたいキーワードを1行に1つずつテキストエディタで書き、これを「usertype.dat」というファイル名で保存する。
  2. 保存したファイル(usertype.dat)を「devenv.exe」というファイルのあるフォルダに保存する。
    Visual C++ 2005 Express Editionでの私の環境では
    C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
    のフォルダに保存します。
  3. VisauStudioを起動する。

 

(情報元)
http://msdn.microsoft.com/ja-jp/library/aa301710(VS.71).aspx

 

すると、こんな感じになります。

 

【キーワード設定前】

キーワードに色を付ける。

 

【キーワード設定後】

キーワードに色を付ける

 

これで少しは見やすくなる?と思います。
参考までに私のusertype.datのテキストを以下に示します。
各自、使いやすいように編集してみて下さい。

 

System

Array
Boolean
Byte
Char
DateTime
Double
Enum
EventArgs
Int16
Int32
Int64
IntPtr
Math
Random
SByte
Single
String
UInt16
UInt32
UInt64

Collections
ComponentModel
Container
Data
Drawing
EventArgs
EventHandler
Object

Bitmap
Brush
Brushes
Color
Font
Graphics
Image
Pen
Pens
Point
PointF
Rectangle
RectangleF
SolidBrush
Size
SizeF

Drawing2D
DashStyle
FillMode
LineCap

Imaging

BitmapData

Diagnostics
Stopwatch

IO

BinaryReader
BinaryWriter
FileStream
StreamReader
StreamWriter
StringReader
StringWriter

Windows

Forms

Application
Button
CheckBox
ComboBox
CommonDialog
Control
Cursor
DataGrid
DataGridView
FileDialog
FontDialog
Form
GroupBox
HScrollBar
ImageList
KeyEventArgs
Label
ListBox
ListView
MainMenu
Menu
MenuStrip
MessageBox
MonthCalender
OpenFileDialog
Padding
Panel
PictureBox
RadioButton
RichText
SaveFileDialog
Screen
ScrollBar
Splitter
SatusBar
SatusStrip
TabControl
TextBox
ToolBar
ToolBarButton
ToolStrip
ToolStripButton
ToolStripComboBox
ToolStripLabel
ToolStripMenuItem
ToolStripSeparator
ToolStripStatusLabel
TreeNode
TreeView
VScrollBar

NULL

IplImage

Ipp8u
Ipp16u

IppStatus
IppiSize
IppiRect

 

Visual Studioへ戻る

 

コメント

タイトルとURLをコピーしました