Visual Basic Radio Button İle Dört İşlem

H

HZ.CİN

Cin Terbiyecisi
Ultra Member
Joined
Dec 22, 2019
Messages
387
Reaction score
73
Location
Cehennem
Bu örneğimizde visual basic ile radio button kullanarak dört işlem yapacağız. Klavyeden girilen iki sayı ile aritmetik işlemleri yapıp sonucu yine ekrana yazdıran program. Klavyeden sayılar girildikten sonra seçilen radio butona göre işlem yapan ve sonucu yazdıran program.


Programın kodları:
Code:
Dim s1, s2 As Integer
    Dim s As Double
 
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
 
        'https://www.bilisimkonulari.com
        s1 = sayi1.Text
        s2 = sayi2.Text
        If topla.Checked = True Then
            s = s1 + s2
        ElseIf cikar.Checked = True Then
            s = s1 - s2
        ElseIf carp.Checked = True Then
            s = s1 * s2
        ElseIf bol.Checked = True And s2 <> 0 Then 'Sıfıra bölme yapmasın.
            s = s1 / s2
        End If
        sonuc.Text = s
 
    End Sub
End Class


vbdortislem1.jpgvbdortislem2.jpgvbdortislem3.jpg
 
SPAM IS FORBIDDEN!
  • SPAMMERS ARE BANNED FROM THE FORUM AND CANNOT USE ANY OF THE CHEATS
  • For example: thanks, thx, very good, asdqwe, working, ty and so on!
  • For example: Writing the same message over and over. thanks, thx and so on!
  • Copying and copying someone else's message is prohibited.
  • It is forbidden to send messages to increase the number of comments on threads that you have no knowledge of.
  • Write your own opinion when commenting!
  • If you see spam message, please let us know with the REPORT button!

Tema düzenleyici

Top Bottom