22-12-2006, 04:11 AM
Visual Basic'i açıp Standart exe'yi seçiyoruz. Formumuza 3 adet Label, 3 adet TextBox, 4 adet OptionButton koyuyoruz.<br>Buraya kadar herşey tamamsa aşağıdaki kodları formunuza yapıştırın.
Kod:
<br><br>Dim ilk, ikinci As Long
<br><br>Private Sub Command1_Click()
ilk = Text1.Text
ikinci = Text2.Text
If Option1.Value = True Then
Text3.Text = ilk + ikinci
End If
If Option2.Value = True Then
Text3.Text = ilk - ikinci
End If
If Option3.Value = True Then
Text3.Text = ilk * ikinci
End If
If Option4.Value = True Then
Text3.Text = ilk / ikinci
End If
End Sub
<br><br>Private Sub Form_Load()
BorderStyle = 1
Caption = "Buraya istediğinizi yazın"
Left = "4740"
Top = "4155"
Text1.Text = "1"
Text2.Text = "1"
Text3.Text = ""
Label1.Caption = "1. Sayı"
Label2.Caption = "2. Sayı"
Label3.Caption = "Sonuç"
Command1.Caption = ">>>"
Option1.Caption = "Toplama"
Option2.Caption = "Çıkarma"
Option3.Caption = "Çarpma"
Option4.Caption = "Bölme"
Option1.Value = True
End Sub
<br><br><br>
<br><br>Private Sub Command1_Click()
ilk = Text1.Text
ikinci = Text2.Text
If Option1.Value = True Then
Text3.Text = ilk + ikinci
End If
If Option2.Value = True Then
Text3.Text = ilk - ikinci
End If
If Option3.Value = True Then
Text3.Text = ilk * ikinci
End If
If Option4.Value = True Then
Text3.Text = ilk / ikinci
End If
End Sub
<br><br>Private Sub Form_Load()
BorderStyle = 1
Caption = "Buraya istediğinizi yazın"
Left = "4740"
Top = "4155"
Text1.Text = "1"
Text2.Text = "1"
Text3.Text = ""
Label1.Caption = "1. Sayı"
Label2.Caption = "2. Sayı"
Label3.Caption = "Sonuç"
Command1.Caption = ">>>"
Option1.Caption = "Toplama"
Option2.Caption = "Çıkarma"
Option3.Caption = "Çarpma"
Option4.Caption = "Bölme"
Option1.Value = True
End Sub
<br><br><br>