Klavyeden girilen 2 adet sayıyı toplayıp ekrandaki label’a yazdıran C# uygulaması;
Bu uygulama için,
2 Adet Textbox;
1 Adet buton;
1 Adet Label ( sonucu göstermek için) Diğer label’lar ile bir işlem yapılmamıştır.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
// Buton içerisine yazılacak kodlar;
private void hesapla_Click(object sender, EventArgs e)
{
int toplam;
toplam = Convert.ToInt32(txt1.Text) + Convert.ToInt32(txt2.Text);
lblsonuc.Text = toplam.ToString();
}
}
}
Ve sonuç:

Abone olun