3000 TL ve üzeri siparişlerde Kargo Ücretsiz!
Income-Expense Tracking App with C# Windows Forms

Income-Expense Tracking App with C# Windows Forms

Step-by-step guide to build an income-expense tracking app with C# Windows Forms. Add income/expenses, list them, and calculate balance.

2 min read 2552 views

In this article, we develop an income-expense tracking application using C# Windows Forms. The application includes adding income and expenses, listing, and balance calculation.

Step 1: Creating the Project and Designing the Interface

  1. First, open Visual Studio and create a new Windows Forms project. Name your project, then switch to form design.

  2. In the form design, add labels, text boxes, and buttons so the user can add income and expenses. Here is an example interface:

    • Label: "Add Income"
    • Text Box: For income amount
    • Text Box: For income description
    • Date Picker: For income date
    • Button: "Add Income"

    Similarly, add interface elements for "Add Expense".

Step 2: Creating the Income and Expense Classes

  1. Create a C# class and define the Income and Expense classes. These classes should have properties such as amount, description, and date.

class Gelir
{
 public decimal Miktar { get; set; }
 public string Aciklama { get; set; }
 public DateTime Tarih { get; set; }
}

class Gider
{
 public decimal Miktar { get; set; }
 public string Aciklama { get; set; }
 public DateTime Tarih { get; set; }
}

Step 3: Form Coding and Creating Functions

  1. In the form's code-behind, define the income and expense collections using the classes we created:

List<Gelir> gelirListesi = new List<Gelir>();
List<Gider> giderListesi = new List<Gider>();

Let's code the click events for the buttons to add income and expenses:

private void btnGelirEkle_Click(object sender, EventArgs e)
{
 Gelir yeniGelir = new Gelir
 {
 Miktar = Convert.ToDecimal(txtGelirMiktar.Text),
 Aciklama = txtGelirAciklama.Text,
 Tarih = dateGelirTarih.Value
 };
 gelirListesi.Add(yeniGelir);
 // Listeyi güncelleme işlevini çağır
}

private void btnGiderEkle_Click(object sender, EventArgs e)
{
 Gider yeniGider = new Gider
 {
 Miktar = Convert.ToDecimal(txtGiderMiktar.Text),
 Aciklama = txtGiderAciklama.Text,
 Tarih = dateGiderTarih.Value
 };
 giderListesi.Add(yeniGider);
 // Listeyi güncelleme işlevini çağır
}

Let's create a function to update the income and expense list:

private void ListeyiGuncelle()
{
 // Gelir listesini güncelleme işlemleri
 // Gider listesini güncelleme işlemleri
 // Toplam bakiye hesaplama
}

Step 4: Conclusion and Testing

  1. Edit the functions you created and bind them to the interface elements on the form.

  2. Test your application. Add income and expenses, and check the lists and total balance.

That's it! We have created the "Income-Expense Tracking Application" project step by step. You can enhance this project by adding more features and making a more user-friendly interface.

Share
Back to all posts

Yorumlar

No comments yet. Be the first to write one.

Your email is not published. Comments are reviewed before publishing.

This form is protected by Google reCAPTCHA; the Google Privacy Policy and Terms of Service apply.

Benzer Yazılar

What is C#? What Does It Do?

What is C#, what is it used for, and where is it used? Learn about Microsoft's object-oriented language C# and its applications in desktop,…

Read More

C# File Renaming Application

Learn step by step how to develop a Windows Forms-based bulk file renaming application with C#. Simplify your file management tasks.

Read More

Developing a Todo List Application with C#

In this guide, you will learn step by step how to develop a to-do list application using C#, including how to use text boxes and buttons. Yo…

Read More
Hızlı Kargo Hafta içi saat 15:00 öncesinde oluşturduğunuz tüm siparişler aynı gün kargoya verilmektedir.
Güvenli Alışveriş Tüm bilgileriniz 256 Bit SSL sertifikasıyla korunmaktadır.
Uzman Teknik Servis Ürünleriniz için profesyonel bakım ve onarım.
Ücretsiz Kargo Belirli tutarın üzerindeki alışverişlerinizde kargo ücreti ödemezsiniz.

Bültenimize Abone Ol

Kampanya ve fırsatlardan ilk siz haberdar olun.

Kuruköprü Mah. Sefa Özler Cad. özden İşmerkezi kat 7/74 Seyhan / adana

Ödeme Yöntemleri

Visa Mastercard Banka Kartı World

©2017 - 2026 All rights reserved.