Free shipping on orders of 3000 TL and above!
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 2590 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

Comments

No comments yet. Be the first to write one.

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

Similar Posts

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
Fast Shipping All orders placed before 15:00 on weekdays are shipped the same day.
Secure Shopping All your information is protected with a 256-bit SSL certificate.
Expert Technical Service Professional maintenance and repair for your products.
Free Shipping No shipping fee on orders above a certain amount.

Subscribe to Our Newsletter

Be the first to hear about campaigns and deals.

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

Payment Methods

Visa Mastercard Debit Card World

©2017 - 2026 All rights reserved.