如图所示,在 txt 里每个数都是用逗号隔开的,但到了最后一个数也是这样, 请问有什么方法可以把最后的一个数替换成句号呢..? 刚学Vb几天,不懂,请指教下.. 代码: Private Sub cmdend_Click() Unload Me End End Sub
Private Sub cmdjs_Click() Dim x As Integer Dim y As Integer Dim z As Integer
If (txtxj.Text <> "" Or txtgj.Text <> "" Or txtmj.Text <> "") Then txtxj.Text = "" txtgj.Text = "" txtmj.Text = "" For x = 0 To 100 For y = 0 To 100 For z = 0 To 100 If (x + y + z = 100 And (0.5 * x + 2 * y + 3 * z) = 100) Then txtxj.Text = txtxj.Text & x & "," txtgj.Text = txtgj.Text & y & "," txtmj.Text = txtmj.Text & z & "," End If Next z Next y Next x
Else
For x = 0 To 100 For y = 0 To 100 For z = 0 To 100 If (x + y + z = 100 And (0.5 * x + 2 * y + 3 * z) = 100) Then txtxj.Text = txtxj.Text & x & "," txtgj.Text = txtgj.Text & y & "," txtmj.Text = txtmj.Text & z & "," End If Next z Next y Next x
End If
End Sub
Private Sub Form_DblClick() txtxj.Text = "" txtgj.Text = "" txtmj.Text = "" cmdjs.SetFocus End Sub
[此贴子已经被作者于2005-8-4 13:49:25编辑过]