Bu darsda siz bilan Visual Basic 6.0 dasturlash tilida oddiy kalkulyator yaratishni ko'rib o'rganib chiqamiz.
' Sana
: 2015-yil 12-Noyabr
' Maqsad : Oddiy Kalkulyator Yaratish
' Muallif : Mo’minjon Abduraimov
Private Sub Combo1_()
Select Case Combo1.ListIndex
Case 0
Label1 = Str$(Val(Text1.Text) +
Val(Text2.Text))
Case 1
Label1 = Str$(Val(Text1.Text) - Val(Text2.Text))
End Select
End Sub
Private Sub Command1_Click()
Select Case Combo1.ListIndex
Case 0
Label1 = Str$(Val(Text1.Text) +
Val(Text2.Text))
Case 1
Label1 = Str$(Val(Text1.Text) -
Val(Text2.Text))
Case 2
Label1 = Str$(Val(Text1.Text) *
Val(Text2.Text))
Case 3
Label1 = Str$(Val(Text1.Text) /
Val(Text2.Text))
End Select
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Combo1.AddItem "+"
Combo1.AddItem "-"
Combo1.AddItem "x"
Combo1.AddItem "÷"
Combo1.ListIndex = 1
End Sub
Bu dasturni ishga tushurganimizda quyidagicha ko'rinishda oyna chiqadi.
Siz bu dasturni mukammallashtirib boshqacha ko'rinishlarga olib kelishingiz mumkin. Keyingi darslarda ko'rishguncha!
Comments
Post a Comment
Iltimos, fikrlaringizni yozib qoldiring !