A lightweight, clean desktop calculator built with C# and Windows Forms. This project was a personal challenge to step away from web development and dive into the .NET ecosystem to practice object-oriented logic and event-driven programming.
- Language: C#
- Framework: .NET 7.0 (WinForms)
- Environment: Developed for Windows (Visual Studio)
- Custom UI: I manually designed the interface, including color-coded buttons (Orange for action, Red for clear) for a better user experience.
- Math Engine: Implemented a robust
switch-caselogic to handle basic operations: addition, subtraction, multiplication, and division. - State Management: The app correctly handles decimal-like behavior, clearing states, and sequential calculations.
To avoid common errors, please follow these instructions carefully.
- Visual Studio 2022: Download the free Community Edition.
- Workload: During installation, you MUST check the box: ".NET desktop development".
- Essential Runtime: This project requires .NET 7.0. If it's not installed, the app won't run.
- You can download it manually here: .NET 7.0 Runtime (Choose "Download x64" under "Desktop Runtime").
Do not run the project directly from the ZIP folder!
- Download the repository and Extract All files to a folder on your computer (e.g., Desktop).
- Go to the project folder.
- Important: Open the file named
Calculator.csproj.- Tip: If you open
Calculator_Project.slnand see a "Project Not Found" error, it means the paths are broken. Just close it and openCalculator.csprojinstead.
- Tip: If you open
- Once Visual Studio loads the project, look at the top-center toolbar.
- Find the Green Play Button (Triangle) labeled Calculator.
- Click it. The calculator window will appear in a few seconds!
Form1.csโ Contains the core mathematical logic and button click events.Form1.Designer.csโ Holds the UI layout and component styling.Program.csโ The main entry point of the application.