TEXTBOX的字符替换功能

hduchanjingjing 2010-01-12 12:23:10
If (txtValueList.Visible) Then
txtValueList.Text = Trim$(txtValueList.Text)
If (txtValueList.Text <> "") Then
strValueList = ""
aryValueList = Split(txtValueList.Text, vbCrLf)
For i = LBound(aryValueList) To UBound(aryValueList)
If (CStr(aryValueList(i)) <> "") Then
If (Len(CStr(aryValueList(i))) > CInt(txtMaxLength.Text)) Then
MsgBox Replace$(GetResString(langFrmFieldErrExceedLen), "%VALUE%", CStr(aryValueList(i))), vbExclamation, Me.Caption
txtValueList.SetFocus
Exit Sub
End If

strValueList = strValueList & CStr(aryValueList(i)) & ","
End If
Next
End If
End If
如何在这段代码中添加上一段新的代码,就是对输入的字符进行一个判断,如果含有,和;的,就取代为空格,txtValueList为textbox的名字
...全文
145 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
king06 2010-01-12
  • 打赏
  • 举报
回复
debug.print replace(Replace(txtValueList,","," "),";"," ")
饭fan有引力 2010-01-12
  • 打赏
  • 举报
回复
你的思想是什么

1,453

社区成员

发帖
与我相关
我的任务
社区描述
VB 控件
社区管理员
  • 控件
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧