用vb编写一个商品结算程序 很简单的 求大神帮忙 5
模仿超市收银的业务流程制作应用程序,界面自定。要求能够将商品及数量添加到购物清单中,能够从购物清单中清除指定数量的商品。能够结算并以对话框的形式显示出最终账单。请将本窗体...
模仿超市收银的业务流程制作应用程序,界面自定。要求能够将商品及数量添加到购物清单中,能够从购物清单中清除指定数量的商品。能够结算并以对话框的形式显示出最终账单。
请将本窗体命名成frmCost。 展开
请将本窗体命名成frmCost。 展开
展开全部
s
Dim shu As String, zong As String
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "未填抽取号码"
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "未填抽取号码数"
Exit Sub
End If
aaa = Val(Text1.Text)
bbb = Val(Text2.Text)
ReDim m(bbb)
For i = 1 To bbb
m(i) = 0
X1:
Randomize
a = Int(Rnd * aaa) + 1
If i = 1 Then
m(1) = a
Else
For j = 1 To i - 1
If a = m(j) Then
GoTo X1
Else
m(i) = a
End If
Next
End If
Next
For k = 1 To bbb
List1.AddItem m(k)
Next k
End Sub
Private Sub Form_Load()
Command1.Caption = "开始抽取"
Label1.Caption = "号码数量,从1到"
Label2.Caption = "抽取数量:"
Text1.Text = ""
Text2.Text = ""
End Sub
Dim shu As String, zong As String
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "未填抽取号码"
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "未填抽取号码数"
Exit Sub
End If
aaa = Val(Text1.Text)
bbb = Val(Text2.Text)
ReDim m(bbb)
For i = 1 To bbb
m(i) = 0
X1:
Randomize
a = Int(Rnd * aaa) + 1
If i = 1 Then
m(1) = a
Else
For j = 1 To i - 1
If a = m(j) Then
GoTo X1
Else
m(i) = a
End If
Next
End If
Next
For k = 1 To bbb
List1.AddItem m(k)
Next k
End Sub
Private Sub Form_Load()
Command1.Caption = "开始抽取"
Label1.Caption = "号码数量,从1到"
Label2.Caption = "抽取数量:"
Text1.Text = ""
Text2.Text = ""
End Sub
追问
大神 你可以截图给我吗?我只看代码看不懂啊 界面也给我看看吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询