欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

vb點(diǎn)虐 怎么做計(jì)算器 vbs做計(jì)算器

有關(guān)vb點(diǎn)虐 制作計(jì)算器的問題

判斷吧,如果點(diǎn)擊+按肢鏈鈕,則一個(gè)全局變量為1,-按鈕,則全鬧陵局變量為2.以此類推,歷彎孫然后if或case判斷哪個(gè)數(shù),如果為1,就兩個(gè)數(shù)相加。

成都創(chuàng)新互聯(lián)公司是一家集網(wǎng)站建設(shè),師宗企業(yè)網(wǎng)站建設(shè),師宗品牌網(wǎng)站建設(shè),網(wǎng)站定制,師宗網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)絡(luò)營銷,網(wǎng)絡(luò)優(yōu)化,師宗網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競爭力。可充分滿足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時(shí)我們時(shí)刻保持專業(yè)、時(shí)尚、前沿,時(shí)刻以成就客戶成長自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。

VB點(diǎn)虐 作業(yè),用VB做一個(gè)簡單的計(jì)算器.

我用VB做的你看能不能用

Public b

Public c

Public d

Public e

Public f

Private Sub Command14_Click()

d = ""

If Text1.Text = "+" Or Text1.Text = "-" Or Text1.Text = "*" Or Text1.Text = "/" Then Exit Sub

'c = Text1.Text

If b = "" Then Exit Sub

If e = "+" Then

d = f + b

Else

If e = "-" Then

d = f - b

Else

If e = "*" Then

d = f * b

Else

If e = "/" Then

If b = 0 Then

MsgBox "被除數(shù)不能為零!"

Exit Sub

End If

d = f / b

Else

MsgBox "錯(cuò)誤操作!"

End If

End If

End If

End If

Text1.Text = d

b = ""

c = ""

e = ""

End Sub

Private Sub Command15_Click()

Text1.Text = ""

b = ""

c = ""

d = ""

e = ""

f = ""

End Sub

Private Sub Form_Load()

Text1.Text = ""

End Sub

Private Sub Command1_Click()

'判斷開頭有運(yùn)算符就清零

If Text1.Text = "握戚+" Or Text1.Text = "-" Or Text1.Text = "*" Or Text1.Text = "/" Then Text1.Text = ""

'判斷開頭有0就禁止輸入數(shù)字

If Text1.Text = "0" Then

Else

a = 1

'發(fā)現(xiàn)運(yùn)算結(jié)果就清零

If d "" Then Text1.Text = "": d = ""

Text1.Text = Text1.Text a

End If

b = Text1.Text '得到當(dāng)前操作數(shù)

End Sub

Private Sub Command2_Click()

If Text1.Text = "+" Or Text1.Text = "-" Or Text1.Text = "*" Or Text1.Text = "/" Then Text1.Text = ""

If Text1.Text = "0" Then

Else

a = 2

If d "" Then Text1.Text = "": d = ""

Text1.Text = Text1.Text a

End If

b = Text1.Text

End Sub

Private Sub Command3_Click()

If Text1.Text = "+" Or Text1.Text = "帆皮局-" Or Text1.Text = "*" Or Text1.Text = "/" Then Text1.Text = ""

If Text1.Text = "0" Then

Else

a = 3

If d "" Then Text1.Text = "": d = ""

Text1.Text = Text1.Text a

End If

b = Text1.Text

End Sub

Private Sub Command4_Click()

If Text1.Text = "態(tài)讓+" Or Text1.Text = "-" Or Text1.Text = "*" Or Text1.Text = "/" Then Text1.Text = ""

If Text1.Text = "0" Then

Else

a = 4

If d "" Then Text1.Text = "": d = ""

Text1.Text = Text1.Text a

End If

b = Text1.Text

End Sub

Private Sub Command5_Click()

If Text1.Text = "+" Or Text1.Text = "-" Or Text1.Text = "*" Or Text1.Text = "/" Then Text1.Text = ""

If Text1.Text = "0" Then

Else

a = 5

If d "" Then Text1.Text = "": d = ""

Text1.Text = Text1.Text a

End If

b = Text1.Text

End Sub

Private Sub Command6_Click()

If Text1.Text = "+" Or Text1.Text = "-" Or Text1.Text = "*" Or Text1.Text = "/" Then Text1.Text = ""

If Text1.Text = "0" Then

Else

a = 6

If d "" Then Text1.Text = "": d = ""

Text1.Text = Text1.Text a

End If

b = Text1.Text

End Sub

Private Sub Command7_Click()

If Text1.Text = "+" Or Text1.Text = "-" Or Text1.Text = "*" Or Text1.Text = "/" Then Text1.Text = ""

If Text1.Text = "0" Then

Else

a = 7

If d "" Then Text1.Text = "": d = ""

Text1.Text = Text1.Text a

End If

b = Text1.Text

End Sub

Private Sub Command8_Click()

If Text1.Text = "+" Or Text1.Text = "-" Or Text1.Text = "*" Or Text1.Text = "/" Then Text1.Text = ""

If Text1.Text = "0" Then

Else

a = 8

If d "" Then Text1.Text = "": d = ""

Text1.Text = Text1.Text a

End If

b = Text1.Text

End Sub

Private Sub Command9_Click()

If Text1.Text = "+" Or Text1.Text = "-" Or Text1.Text = "*" Or Text1.Text = "/" Then Text1.Text = ""

If Text1.Text = "0" Then

Else

a = 9

If d "" Then Text1.Text = "": d = ""

Text1.Text = Text1.Text a

End If

b = Text1.Text

End Sub

Private Sub Command10_Click()

If b = "" Then Exit Sub

a = "+"

e = "+"

f = b

Text1.Text = ""

Text1.Text = Text1.Text a

End Sub

Private Sub Command11_Click()

If b = "" Then Exit Sub

f = b

a = "-"

e = "-"

Text1.Text = ""

Text1.Text = Text1.Text a

End Sub

Private Sub Command12_Click()

If b = "" Then Exit Sub

a = "*"

e = "*"

f = b

Text1.Text = ""

Text1.Text = Text1.Text a

End Sub

Private Sub Command13_Click()

If b = "" Then Exit Sub

a = "/"

e = "/"

f = b '把操作數(shù)1提取出來

Text1.Text = ""

Text1.Text = Text1.Text a

End Sub

Private Sub Command16_Click()

'判斷有運(yùn)算符就清零

If Text1.Text = "+" Or Text1.Text = "-" Or Text1.Text = "*" Or Text1.Text = "/" Then Text1.Text = ""

'判斷有零和空值就禁止輸入0

'發(fā)現(xiàn)運(yùn)算結(jié)果就清零

If d "" Then Text1.Text = "": d = ""

If Text1.Text = "0" Then

Else

a = 0

If d "" Then Text1.Text = "": d = ""

Text1.Text = Text1.Text a

b = Text1.Text

End If

End Sub

如何用vb編寫簡單計(jì)算器

不知道你想要哪種,偶是新手,只會最簡單的

首先拖出三個(gè)text,再拖出4個(gè)Command按鈕 caption分別為+ - * / 這樣就準(zhǔn)備就緒了

先講一下簡單用法,第一纖森個(gè)text是第一個(gè)加數(shù)/被減數(shù)虛豎悔/因數(shù)/被除數(shù),而第二個(gè)text是第二個(gè)加數(shù)/減數(shù)/因數(shù)/除數(shù),第三個(gè)text是和/差/積/商,在text1輸入一個(gè)數(shù),text2輸入一個(gè),然后分別點(diǎn)擊command“+ - * /”text3就差正會出現(xiàn)結(jié)果

然后隨便單擊一個(gè)窗口,把里面的文字刪去,再寫上:

Private Sub Command1_Click()

Text3.Text = Str$(Val(Text1.Text) + Val(Text2.Text))

End Sub

Private Sub Command2_Click()

Text3.Text = Str$(Val(Text1.Text) - Val(Text2.Text))

End Sub

Private Sub Command3_Click()

Text3.Text = Str$(Val(Text1.Text) * Val(Text2.Text))

End Sub

Private Sub Command4_Click()

Text3.Text = Str$(Val(Text1.Text) / Val(Text2.Text))

End Sub

然后運(yùn)行,應(yīng)該就可以了

怎么用vb做一個(gè)電費(fèi)的計(jì)算器?

在窗體上添加一個(gè)Text1控件, 用于輸入電費(fèi)單價(jià);再添加一個(gè)Text2控件,用于輸入渣局鬧電量;再添加一個(gè)Text3, 用于輸出計(jì)算結(jié)果;最后添加一個(gè)Command1按鈕如罩。代碼臘敗如下:

Private Sub Command1_Click()

Text3.Text = Val(Text1.Text) * Val(Text2.Text)

End Sub

標(biāo)題名稱:vb點(diǎn)虐 怎么做計(jì)算器 vbs做計(jì)算器
當(dāng)前網(wǎng)址:http://www.chinadenli.net/article40/ddpeeho.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計(jì)自適應(yīng)網(wǎng)站Google品牌網(wǎng)站建設(shè)面包屑導(dǎo)航服務(wù)器托管

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

商城網(wǎng)站建設(shè)