Forum Elemanları
3 textbox
3 Label
1 command
Dim gfx As Double
Dim a As Double
Dim b As Double
Private Sub Command1_Click()
a = Text1.Text
b = Text2.Text
gfx = a + b
Text3.Text = gfx
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label1.Caption = "1. sayi :"
Label2.Caption = "2. sayi :"
Label3.Caption = "toplam :"
Command1.Caption = "Topla"
End Sub
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
Dim x As Integer
x = InStr(1, Text1, ",")
If x > 0 Then
Text1 = Format(Text1, "##,##0.##")
Text1.SelStart = Len(Text1.Text)
End If
If x = 0 Then
Text1 = Format(Text1, "##,##0")
Text1.SelStart = Len(Text1.Text)
End If
End Sub
Private Sub Text2_KeyUp(KeyCode As Integer, Shift As Integer)
Dim x As Integer
x = InStr(1, Text2, ",")
If x > 0 Then
Text2 = Format(Text2, "##,##0.##")
Text2.SelStart = Len(Text2.Text)
End If
If x = 0 Then
Text2 = Format(Text2, "##,##0")
Text2.SelStart = Len(Text2.Text)
End If
End Sub
3 textbox
3 Label
1 command
Dim gfx As Double
Dim a As Double
Dim b As Double
Private Sub Command1_Click()
a = Text1.Text
b = Text2.Text
gfx = a + b
Text3.Text = gfx
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label1.Caption = "1. sayi :"
Label2.Caption = "2. sayi :"
Label3.Caption = "toplam :"
Command1.Caption = "Topla"
End Sub
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
Dim x As Integer
x = InStr(1, Text1, ",")
If x > 0 Then
Text1 = Format(Text1, "##,##0.##")
Text1.SelStart = Len(Text1.Text)
End If
If x = 0 Then
Text1 = Format(Text1, "##,##0")
Text1.SelStart = Len(Text1.Text)
End If
End Sub
Private Sub Text2_KeyUp(KeyCode As Integer, Shift As Integer)
Dim x As Integer
x = InStr(1, Text2, ",")
If x > 0 Then
Text2 = Format(Text2, "##,##0.##")
Text2.SelStart = Len(Text2.Text)
End If
If x = 0 Then
Text2 = Format(Text2, "##,##0")
Text2.SelStart = Len(Text2.Text)
End If
End Sub