| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 580 人关注过本帖
标题:[求助]刚学Vb,就有问题了.
取消只看楼主 加入收藏
akimoto
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2005-6-2
收藏
 问题点数:0 回复次数:1 
[求助]刚学Vb,就有问题了.

图片附件: 游客没有浏览图片的权限,请 登录注册
如图所示,在 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编辑过]

搜索更多相关主题的帖子: 如图所示 
2005-08-04 13:43
akimoto
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2005-6-2
收藏
得分:0 
贴了..

2005-08-04 13:49
快速回复:[求助]刚学Vb,就有问题了.
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028903 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved