這個(gè)啊,呵呵,應(yīng)該不難吧
10年積累的成都做網(wǎng)站、成都網(wǎng)站建設(shè)、成都外貿(mào)網(wǎng)站建設(shè)經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先網(wǎng)站制作后付款的網(wǎng)站建設(shè)流程,更有大邑縣免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。
先找到你要打開的應(yīng)用程序的文件
然后用一個(gè)調(diào)用代碼:
System.Diagnostics.Process.Start("C:\WINDOWS\system32\notepad.exe")
這是要枯高前開記事本的
System.Diagnostics.Process.Start("C:\WINDOWS\system32\calc.exe")
這是打開計(jì)算器的
應(yīng)念塌該也可以把這兩個(gè)應(yīng)用程序復(fù)制到你的程序的默認(rèn)目錄下,就是BIN下吧!
呵呵,試沒清試?。∫o我加分哦?。?!
Public C護(hù)激篙刻蕻灸戈熏讓賀恭抹lass Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim c As Char
c = Trim(TextBox3.Text)
Select Case c
Case "察滑桐敗坦+"
TextBox4.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
Case "-"
TextBox4.Text = Val(TextBox1.Text) - Val(TextBox2.Text)
Case "*"
TextBox4.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
Case "\"
If Val(TextBox2.Text) = 0 Then
MsgBox("分母為0")
Else
TextBox4.Text = Val(TextBox1.Text) \ Val(TextBox2.Text)
End If
Case "/"
If Val(TextBox2.Text) = 0 Then
MsgBox("分母為0")
Else
TextBox4.Text = Val(TextBox1.Text) / Val(TextBox2.Text)
End If
End Select
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
代碼如下:
Dim t, t1 As Integer
Dim x, y As Double
Public Sub com()
x = Val(l1.Caption)
Select Case t1
Case Is = 1: y = y + x
Case Is = 2: y = y - x
Case Is = 3: y = y * x
Case Is = 4: y = y / x
End Select
t1 = 0
t = 0
l1.Caption = "0"
End Sub
Private Sub Form_Load()
x = 0
y = 0
t = 0
t1 = 1
End Sub
Private Sub c0_Click(Index As Integer)
If l1.Caption = "0" Then
l1.Caption = "0"
Else
l1.Caption = l1.Caption + "0"
End If
End Sub
Private Sub C1_Click(Index As Integer)
If l1.Caption = "0" Then
l1.Caption = "1"
Else
l1.Caption = l1.Caption + "1"
End If
End Sub
Private Sub c10_Click(Index As Integer)
If t = 0 Then
l1.Caption = l1.Caption + "."弊含
t = 1
End If
End Sub
Private Sub C2_Click(Index As Integer)
If l1.Caption = "0" Then
l1.Caption = "2"
Else
l1.Caption = l1.Caption + "租賣笑2"
End If
End Sub
Private Sub C3_Click(Index As Integer)
If l1.Caption = "0" Then
l1.Caption = "3"
Else
l1.Caption = l1.Caption + "3"
End If
End Sub
Private Sub C4_Click(Index As Integer)
If l1.Caption = "0" Then
l1.Caption = "4"
Else
l1.Caption = l1.Caption + "4"
End If
End Sub
Private Sub C5_Click(Index As Integer)
If l1.Caption = "0" Then
l1.Caption = "5"
Else
l1.Caption = l1.Caption + "5"
End If
End Sub
Private Sub C6_Click(Index As Integer)
If l1.Caption = "0" Then
l1.Caption = "配塵6"
Else
l1.Caption = l1.Caption + "6"
End If
End Sub
Private Sub C7_Click(Index As Integer)
If l1.Caption = "0" Then
l1.Caption = "7"
Else
l1.Caption = l1.Caption + "7"
End If
End Sub
Private Sub C8_Click(Index As Integer)
If l1.Caption = "0" Then
l1.Caption = "8"
Else
l1.Caption = l1.Caption + "8"
End If
End Sub
Private Sub C9_Click(Index As Integer)
If l1.Caption = "0" Then
l1.Caption = "9"
Else
l1.Caption = l1.Caption + "9"
End If
End Sub
Private Sub z1_Click(Index As Integer)
com
t1 = 1
End Sub
Private Sub z2_Click(Index As Integer)
com
t1 = 2
End Sub
Private Sub z3_Click(Index As Integer)
com
t1 = 3
End Sub
Private Sub z4_Click(Index As Integer)
com
t1 = 4
End Sub
Private Sub z5_Click(Index As Integer)
tmp = Mid(l1.Caption, Len(l1.Caption), 1)
If tmp = "." Then
t = 0
End If
If Len(l1.Caption) = 1 Then
l1.Caption = "0"
Else
l1.Caption = Left(l1.Caption, Len(l1.Caption) - 1)
End If
End Sub
Private Sub z6_Click(Index As Integer)
l1.Caption = "0"
Form_Load
End Sub
Private Sub z7_Click(Index As Integer)
If (l1.Caption "0") Then
l1.Caption = "-" + l1.Caption
End If
End Sub
Private Sub z8_Click(Index As Integer)
com
l1.Caption = Str(y)
End Sub
擴(kuò)展資料
語(yǔ)言缺點(diǎn)
Visual Basic 語(yǔ)言具有不支持繼承、無(wú)原生支持多線程、異常處理不完善等三項(xiàng)明顯缺點(diǎn),使其有所局限性(此些缺點(diǎn)皆已在 vb 點(diǎn)虐 獲得改進(jìn))。
不支持繼承
VB 5.0 和 VB 6.0 都是基于對(duì)象的編程語(yǔ)言,但是不包含繼承特性。VB 中提供了特殊的類的功能,但是還是不能滿足程序員的需求。
無(wú)原生支持多線程
Visual Basic 對(duì)于多線程無(wú)原生支持,只能通過Windows API的調(diào)用實(shí)現(xiàn),且極其的不穩(wěn)定。因?yàn)樵贏PI創(chuàng)建的線程中,并沒有自動(dòng)初始化運(yùn)行時(shí)庫(kù),導(dǎo)致部分的函數(shù)無(wú)法使用。一般的,在VB6等早期的VB開發(fā)環(huán)境下,使用API創(chuàng)建線程的目的是完成容易使程序假死的大量數(shù)據(jù)或者邏輯的計(jì)算。
異常處理不完善
Visual Basic 中內(nèi)置異常處理,即使未寫異常處理代碼,一旦用戶出錯(cuò)也會(huì)彈出一個(gè)明確寫出出錯(cuò)原因?qū)υ捒?,接著程序終止。
Visual Basic 中可以使用 Err.Raise拋出異常。對(duì)系統(tǒng)及用戶拋出的異常的處理常用兩種模式:一是使用 On Error Resume Next 處理錯(cuò)誤;另一種是使用 On Error Goto 將運(yùn)行引入錯(cuò)誤處理代碼。但相對(duì) C++ 等語(yǔ)言而言,這樣的異常處理破壞了代碼的結(jié)構(gòu)。
參考資料:百度百科-VB
你自己顫灶加窗體和空茄乎扮頃信件吧
Private Sub a1_Click()
X = Val(Text1.Text)
Y = Val(Text2.Text)
s = X + Y
Text3.Text = s
Text3.Locked = True
End Sub
Private Sub a2_Click()
X = Val(Text1.Text)
Y = Val(Text2.Text)
s = X - Y
Text3.Text = s
Text3.Locked = True
End Sub
Private Sub a3_Click()
X = Val(Text1.Text)
Y = Val(Text2.Text)
s = X * Y
Text3.Text = s
Text3.Locked = True
End Sub
Private Sub a4_Click()
X = Val(Text1.Text)
Y = Val(Text2.Text)
s = X / Y
Text3.Text = s
Text3.Locked = True
End Sub
不會(huì)的叫我 在線談
分享文章:vb點(diǎn)虐
實(shí)現(xiàn)計(jì)算器的簡(jiǎn)單介紹
分享網(wǎng)址:http://jinyejixie.com/article26/ddpihcg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站排名、品牌網(wǎng)站設(shè)計(jì)、企業(yè)建站、做網(wǎng)站、Google、網(wǎng)站導(dǎo)航
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)