📄 form1.frm
字号:
RichTextBox1.SelLength = 1
RichTextBox1.SelColor = RGB(171, 171, 172)
RichTextBox1.SelStart = m
mycounter = filewordlength
End If
ElseIf myfileshuzu(filewordlength) = Chr(124) And flag = False And flagy = False And flagd = False Then
'检查到&号
If myfileshuzu(filewordlength - 1) = Chr(124) Then
'改变&的颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = filewordlength - 1
RichTextBox1.SelLength = 1
RichTextBox1.SelColor = RGB(171, 171, 172)
RichTextBox1.SelStart = m
mycounter = filewordlength
Else
'改变字体颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(255, 0, 0)
RichTextBox1.SelStart = m
wordstart = mycounter + 1
For wordstart = wordstart To filewordlength Step 1
If (myfileshuzu(wordstart) >= "a" And myfileshuzu(wordstart) <= "z") Or (myfileshuzu(wordstart) >= "A" And myfileshuzu(wordstart) <= "Z") Or (myfileshuzu(wordstart) >= "0" And myfileshuzu(wordstart) <= "9") Then
Exit For
End If
Next wordstart
If wordstart > filewordlength Then
wordstart = filewordlength
End If
flagb = biaoshifu(myfileshuzu(), wordstart, filewordlength)
'改变表示符的颜色
If flagb = True Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(240, 171, 5)
RichTextBox1.SelStart = m
End If
flags = shuzi(myfileshuzu(), wordstart, filewordlength)
'改变数字的颜色
If flags = True Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(36, 36, 100)
RichTextBox1.SelStart = m
End If
mykey = Mid$(filetext, wordstart, filewordlength - wordstart)
flagg = guanjianzi(mykey)
If flagg = True Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(45, 21, 125)
RichTextBox1.SelStart = m
mycounter = filewordlength
End If
'改变|的颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = filewordlength - 1
RichTextBox1.SelLength = 1
RichTextBox1.SelColor = RGB(171, 171, 172)
RichTextBox1.SelStart = m
mycounter = filewordlength
End If
ElseIf myfileshuzu(filewordlength) = Chr(60) And flag = False And flagy = False And flagd = False Then
'检查到&号
If myfileshuzu(filewordlength - 1) = Chr(60) Then
'改变<的颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = filewordlength - 1
RichTextBox1.SelLength = 1
RichTextBox1.SelColor = RGB(171, 171, 172)
RichTextBox1.SelStart = m
mycounter = filewordlength
Else
'改变字体颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(255, 0, 0)
RichTextBox1.SelStart = m
wordstart = mycounter + 1
For wordstart = wordstart To filewordlength Step 1
If (myfileshuzu(wordstart) >= "a" And myfileshuzu(wordstart) <= "z") Or (myfileshuzu(wordstart) >= "A" And myfileshuzu(wordstart) <= "Z") Or (myfileshuzu(wordstart) >= "0" And myfileshuzu(wordstart) <= "9") Then
Exit For
End If
Next wordstart
If wordstart > filewordlength Then
wordstart = filewordlength
End If
flagb = biaoshifu(myfileshuzu(), wordstart, filewordlength)
'改变表示符的颜色
If flagb = True Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(240, 171, 5)
RichTextBox1.SelStart = m
End If
flags = shuzi(myfileshuzu(), wordstart, filewordlength)
'改变数字的颜色
If flags = True Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(36, 36, 100)
RichTextBox1.SelStart = m
End If
mykey = Mid$(filetext, wordstart, filewordlength - wordstart)
flagg = guanjianzi(mykey)
If flagg = True Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(45, 21, 125)
RichTextBox1.SelStart = m
mycounter = filewordlength
End If
'改变<的颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = filewordlength - 1
RichTextBox1.SelLength = 1
RichTextBox1.SelColor = RGB(171, 171, 172)
RichTextBox1.SelStart = m
mycounter = filewordlength
End If
ElseIf myfileshuzu(filewordlength) = Chr(62) And flag = False And flagy = False And flagd = False Then
'检查到&号
If myfileshuzu(filewordlength - 1) = Chr(62) Then
'改变>的颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = filewordlength - 1
RichTextBox1.SelLength = 1
RichTextBox1.SelColor = RGB(171, 171, 172)
RichTextBox1.SelStart = m
mycounter = filewordlength
Else
'改变字体颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(255, 0, 0)
RichTextBox1.SelStart = m
wordstart = mycounter + 1
For wordstart = wordstart To filewordlength Step 1
If (myfileshuzu(wordstart) >= "a" And myfileshuzu(wordstart) <= "z") Or (myfileshuzu(wordstart) >= "A" And myfileshuzu(wordstart) <= "Z") Or (myfileshuzu(wordstart) >= "0" And myfileshuzu(wordstart) <= "9") Then
Exit For
End If
Next wordstart
If wordstart > filewordlength Then
wordstart = filewordlength
End If
flagb = biaoshifu(myfileshuzu(), wordstart, filewordlength)
'改变表示符的颜色
If flagb = True Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(240, 171, 5)
RichTextBox1.SelStart = m
End If
flags = shuzi(myfileshuzu(), wordstart, filewordlength)
'改变数字的颜色
If flags = True Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(36, 36, 100)
RichTextBox1.SelStart = m
End If
mykey = Mid$(filetext, wordstart, filewordlength - wordstart)
flagg = guanjianzi(mykey)
If flagg = True Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(45, 21, 125)
RichTextBox1.SelStart = m
mycounter = filewordlength
End If
'改变>的颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = filewordlength - 1
RichTextBox1.SelLength = 1
RichTextBox1.SelColor = RGB(171, 171, 172)
RichTextBox1.SelStart = m
mycounter = filewordlength
End If
End If
If myfileshuzu(filewordlength) = Chr(42) And flag = False And flagy = False And flagd = False Then
'检查到*号
If myfileshuzu(filewordlength - 1) <> "/" Then
'改变字体颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(255, 0, 0)
RichTextBox1.SelStart = m
wordstart = mycounter + 1
For wordstart = wordstart To filewordlength Step 1
If (myfileshuzu(wordstart) >= "a" And myfileshuzu(wordstart) <= "z") Or (myfileshuzu(wordstart) >= "A" And myfileshuzu(wordstart) <= "Z") Or (myfileshuzu(wordstart) >= "0" And myfileshuzu(wordstart) <= "9") Then
Exit For
End If
Next wordstart
If wordstart > filewordlength Then
wordstart = filewordlength
End If
flagb = biaoshifu(myfileshuzu(), wordstart, filewordlength)
'改变表示符的颜色
If flagb = True Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(240, 171, 5)
RichTextBox1.SelStart = m
End If
flags = shuzi(myfileshuzu(), wordstart, filewordlength)
'改变数字的颜色
If flags = True Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(36, 36, 100)
RichTextBox1.SelStart = m
End If
mykey = Mid$(filetext, wordstart, filewordlength - wordstart)
flagg = guanjianzi(mykey)
If flagg = True Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(45, 21, 125)
RichTextBox1.SelStart = m
mycounter = filewordlength
End If
'改变*的颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = filewordlength - 1
RichTextBox1.SelLength = 1
RichTextBox1.SelColor = RGB(171, 171, 172)
RichTextBox1.SelStart = m
mycounter = filewordlength
End If
End If
If myfileshuzu(filewordlength) = Chr(47) And flag = False And flagy = False And flagd = False Then
'检查到*号
If myfileshuzu(filewordlength - 1) <> "*" Then
'改变字体颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(255, 0, 0)
RichTextBox1.SelStart = m
wordstart = mycounter + 1
For wordstart = wordstart To filewordlength Step 1
If (myfileshuzu(wordstart) >= "a" And myfileshuzu(wordstart) <= "z") Or (myfileshuzu(wordstart) >= "A" And myfileshuzu(wordstart) <= "Z") Or (myfileshuzu(wordstart) >= "0" And myfileshuzu(wordstart) <= "9") Then
Exit For
End If
Next wordstart
If wordstart > filewordlength Then
wordstart = filewordlength
End If
flagb = biaoshifu(myfileshuzu(), wordstart, filewordlength)
'改变表示符的颜色
If flagb = True Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(240, 171, 5)
RichTextBox1.SelStart = m
End If
flags = shuzi(myfileshuzu(), wordstart, filewordlength)
'改变数字的颜色
If flags = True Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(36, 36, 100)
RichTextBox1.SelStart = m
End If
mykey = Mid$(filetext, wordstart, filewordlength - wordstart)
flagg = guanjianzi(mykey)
If flagg = True Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(45, 21, 125)
RichTextBox1.SelStart = m
mycounter = filewordlength
End If
'改变/的颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = filewordlength - 1
RichTextBox1.SelLength = 1
RichTextBox1.SelColor = RGB(171, 171, 172)
RichTextBox1.SelStart = m
mycounter = filewordlength
End If
End If
Next filewordlength
End Sub
Private Function guanjianzi(mykey As String)
Static key(35) As String
Dim i As Long
Static panduan As Boolean
key(1) = "auto"
key(2) = "break"
key(3) = "case"
key(4) = "char"
key(5) = "const"
key(6) = "continue"
key(7) = "default"
key(8) = "do"
key(9) = "double"
key(10) = "else"
key(11) = "enum"
key(12) = "extern"
key(13) = "float"
key(14) = "for"
key(15) = "goto"
key(16) = "if"
key(17) = "int"
key(18) = "long"
key(19) = "register"
key(20) = "return"
key(21) = "short"
key(22) = "signed"
key(23) = "sizeof"
key(24) = "static"
key(25) = "struct"
key(26) = "switch"
key(27) = "typedef"
key(28) = "union"
key(29) = "void"
key(30) = "volatile"
key(31) = "while"
panduan = False
mykey = Trim(mykey)
For i = 1 To 31 Step 1
If key(i) = mykey Then
panduan = True
Exit For
End If
Next i
guanjianzi = panduan
End Function
Private Function biaoshifu(myshuzu(), wordstart As Long, length As Long)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -