📄 form1.frm
字号:
mycounter = filewordlength
End If
'改变左中括号的颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = filewordlength - 1
RichTextBox1.SelLength = 1
RichTextBox1.SelColor = RGB(0, 0, 255)
RichTextBox1.SelStart = m
mycounter = filewordlength
ElseIf myfileshuzu(filewordlength) = Chr(93) And flag = False And flagy = False And flagd = False 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(0, 0, 255)
RichTextBox1.SelStart = m
mycounter = filewordlength
ElseIf myfileshuzu(filewordlength) = Chr(40) And flag = False And flagy = False And flagd = False 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(0, 0, 255)
RichTextBox1.SelStart = m
mycounter = filewordlength
ElseIf myfileshuzu(filewordlength) = Chr(41) And flag = False And flagy = False And flagd = False 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(0, 0, 255)
RichTextBox1.SelStart = m
mycounter = filewordlength
ElseIf myfileshuzu(filewordlength) = Chr(39) And flag = False And flagy = False Then
'当按下的是单引号
If flagd = False 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(0, 0, 255)
RichTextBox1.SelStart = m
mycounter = filewordlength
flagd = True
counterd = 1
End If
If flagd = True And counterd = 2 Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(125, 125, 125)
RichTextBox1.SelStart = m
mycounter = filewordlength
'改变单引号的颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = filewordlength - 1
RichTextBox1.SelLength = 1
RichTextBox1.SelColor = RGB(0, 0, 255)
RichTextBox1.SelStart = m
mycounter = filewordlength
flagd = False
End If
counterd = counterd + 1
ElseIf myfileshuzu(filewordlength) = Chr(34) And flag = False And flagd = False Then
'当按下的是双引号
If flagy = False 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(0, 0, 255)
RichTextBox1.SelStart = m
mycounter = filewordlength
flagy = True
countery = 1
End If
If flagy = True And countery = 2 Then
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(125, 125, 125)
RichTextBox1.SelStart = m
mycounter = filewordlength
'改变双引号的颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = filewordlength - 1
RichTextBox1.SelLength = 1
RichTextBox1.SelColor = RGB(0, 0, 255)
RichTextBox1.SelStart = m
mycounter = filewordlength
flagy = False
End If
countery = countery + 1
ElseIf (myfileshuzu(filewordlength) = Chr(42) Or myfileshuzu(filewordlength) = Chr(47)) And flagy = False And flagd = False Then
'添加对注释的支持
'检查到*号
If myfileshuzu(filewordlength - 1) = "/" And flag = False Then
mycounter = filewordlength - 1
'改变/*的颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = filewordlength - 2
RichTextBox1.SelLength = 2
RichTextBox1.SelColor = RGB(0, 255, 0)
RichTextBox1.SelStart = m
mycounter = filewordlength
flag = True
End If
If myfileshuzu(filewordlength) = Chr(47) Then
'检查到/键时
If myfileshuzu(filewordlength - 1) = "*" And flag = True Then
'改变字体颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = filewordlength - mycounter
RichTextBox1.SelColor = RGB(0, 255, 0)
RichTextBox1.SelStart = m
mycounter = filewordlength - 2
'改变*/的颜色
'改变/*的颜色
m = RichTextBox1.SelStart
RichTextBox1.SelStart = mycounter
RichTextBox1.SelLength = 2
RichTextBox1.SelColor = RGB(0, 255, 0)
RichTextBox1.SelStart = m
mycounter = filewordlength
flag = False
End If
End If
ElseIf myfileshuzu(filewordlength) = Chr(61) And flag = False And flagy = False And flagd = False Then
'检查到=号
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -