VB 6.0 计算鼠标的金额 字体
生活随笔
收集整理的這篇文章主要介紹了
VB 6.0 计算鼠标的金额 字体
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
實驗內容
實驗環境
Windows7,Office、VB開發環境。
窗體
代碼
vb已經沒什么人用了吧…
Private Sub Command1_Click()Dim oneprice As Single '一個的價格Dim num As Single '購買的數量Dim discount As SingleDim totalprice As Singleoneprice = Val(Text1.Text)num = Val(Text2.Text)'計算折扣If num >= 20 Thendiscount = 0.7ElseIf num >= 10 Thendiscount = 0.8Elsediscount = 0.95End If'計算價格totalprice = oneprice * num * discountLabel6.Caption = totalpriceEnd SubPrivate Sub Command2_Click()'應付Dim totalprice As Singletotalprice = Val(Label6.Caption)'實付Dim giveprice As Singlegiveprice = Val(Text3.Text)'找零Dim backprice As Singlebackprice = giveprice - totalprice'輸出Label7.Caption = backpriceIf backprice < 0 ThenMsgBox "付款不足!"End IfEnd SubPrivate Sub Form_Load()End Sub字體屬性設置
總結
以上是生活随笔為你收集整理的VB 6.0 计算鼠标的金额 字体的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 网易2019实习生招聘题目 被3整除
- 下一篇: 算法设计与分析(第四周)同时选最大和最小