第1个回答 2013-08-03
我也是一个初学者,我想这也许可以用这样来实现
PrivateSubRichTextBox1_Change()
Dima,b,i
IfRichTextBox1.SelStart<4ThenExitSub
b=RichTextBox1.SelStart
Fori=1To4
RichTextBox1.SelStart=RichTextBox1.SelStart-1
RichTextBox1.SelLength=4
Next
IfRichTextBox1.SelText="echo"Then
DoWhileAsc(RichTextBox1.SelText)<>13AndRichTextBox1.SelStart<>0
RichTextBox1.SelStart=RichTextBox1.SelStart-1
RichTextBox1.SelLength=4
IfRichTextBox1.SelText="echo"Then
RichTextBox1.SelStart=b
RichTextBox1.SelLength=0
ExitSub
EndIf
Loop
RichTextBox1.SelStart=b-4
RichTextBox1.SelLength=4
RichTextBox1.SelBold=True
EndIf
RichTextBox1.SelStart=b
RichTextBox1.SelLength=0
RichTextBox1.SelBold=False
EndSub