vb中的运算只有一个textbox控件该怎么赋值
2个回答
2017-02-15
展开全部
Private Sub Text1_Click() '单击Text1后发生
Dim i, inpa, GetTxt(500) As Variant, GotText As String
GotText = "" ' Text1.Text
For i = 0 To UBound(Split(Text1.Text, vbCrLf)) - 1
GetTxt(i) = Split(Text1.Text, vbCrLf)(i)
inpa = InputBox("[第" & (i + 1) & "行] " & GetTxt(i), "添加到TextBox1", GetTxt(i))
'(i) = GotText & vbCrLf & inpa
GotText = GotText & vbCrLf & inpa
If Len(inpa) < 1 Then
MsgBox Replace(Text1.Text, GotText, ""), vbOKOnly, "TextBox1原内容"
Exit For
End If
Next
Text1.Text = GotText
End Sub
Dim i, inpa, GetTxt(500) As Variant, GotText As String
GotText = "" ' Text1.Text
For i = 0 To UBound(Split(Text1.Text, vbCrLf)) - 1
GetTxt(i) = Split(Text1.Text, vbCrLf)(i)
inpa = InputBox("[第" & (i + 1) & "行] " & GetTxt(i), "添加到TextBox1", GetTxt(i))
'(i) = GotText & vbCrLf & inpa
GotText = GotText & vbCrLf & inpa
If Len(inpa) < 1 Then
MsgBox Replace(Text1.Text, GotText, ""), vbOKOnly, "TextBox1原内容"
Exit For
End If
Next
Text1.Text = GotText
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询