sessizadam
Üye
- Katılım
- 21 Ocak 2023
- Mesajlar
- 338
- Tepkime puanı
- 27
- Puanları
- 28
İtibar:
Algoritma ve programlama eğitiminde Visual Basic ilk öğrenilen programlama dillerinden bir tanesidir. Ofis programlarında macro oluştururken, küçük işletmeler için form uygulamaları yazarken sıklıkla tercih ederiz. Basit kod en büyük ve en küçük sayıyı bulan kısa bir kod ile program.
Kod:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Val(TextBox1.Text) > Val(TextBox2.Text) And Val(TextBox1.Text) > Val(TextBox3.Text) Then
TextBox4.Text = TextBox1.Text
End If
If Val(TextBox2.Text) > Val(TextBox1.Text) And Val(TextBox2.Text) > Val(TextBox3.Text) Then
TextBox4.Text = TextBox2.Text
End If
If Val(TextBox3.Text) > Val(TextBox1.Text) And Val(TextBox3.Text) > Val(TextBox2.Text) Then
TextBox4.Text = TextBox3.Text
End If
If Val(TextBox1.Text) < Val(TextBox2.Text) And Val(TextBox1.Text) < Val(TextBox3.Text) Then
TextBox5.Text = TextBox1.Text
End If
If Val(TextBox2.Text) < Val(TextBox1.Text) And Val(TextBox2.Text) < Val(TextBox3.Text) Then
TextBox5.Text = TextBox2.Text
End If
If Val(TextBox3.Text) < Val(TextBox1.Text) And Val(TextBox3.Text) < Val(TextBox2.Text) Then
TextBox5.Text = TextBox3.Text
End If
End Sub
End Class