Private Sub Text1_Change()
Static s_ReEntry As Boolean
If s_ReEntry Then Exit Sub
s_ReEntry = True
'将 Text、SelStart、SelLength 分别存入变量;
'对 Text 进行从右到左的逐个字符扫描:
' 在需要的位置添加字符 ",",在不需要的位置删除字符 ",",
' 添加和删除字符时调整 SelStart、SelLength 的值;
'将 Text、SelStart、SelLength 变量赋值给 Text1;
s_ReEntry = False
End Sub