字符串更新
Private Sub picWelcome_Click()
Dim strFileFullName As String
Dim vFillPName As Variant
Dim vFillTName As Variant
Dim strNewName As String
Dim strOldName As String
On Error Resume Next
commPicture.Filter = "*.jpg |*.JPG,*.bmp |*.bmp,*.JPEG|*.jpeg,*.PNG|*.png,*.GIF|*.gif"
commPicture.ShowOpen
strFileFullName = commPicture.FileName
' If FN <> "" Then
' picWelcome.Picture = LoadPicture(FN)
' End If
vFillPName = Split(strFileFullName, "\")
If strFileFullName <> "" Then
strNewName = vFillPName(UBound(vFillPName))
End If
If txtSignOnPic.Text <> "" Then
vFillTName = Split(txtSignOnPic.Text, "\")
strOldName = vFillTName(UBound(vFillTName))
End If
txtSignOnPic.Text = Replace(txtSignOnPic.Text, strOldName, strNewName)
‘txtSignOnPic.Text = strNewName -------这句可以执行但是不能达到效果
End Sub
txtSignOnPic.Text = Replace(txtSignOnPic.Text, strOldName, strNewName)
我用了Replace函数进行更新字符串,语句执行后txtSignOnPic.Text值没有更新,谁给看看。