{"id":15163461,"url":"https://github.com/anlbora/calculator-wpf-net","last_synced_at":"2026-01-21T02:31:49.046Z","repository":{"id":245176550,"uuid":"817485624","full_name":"anlbora/Calculator-WPF-NET","owner":"anlbora","description":"This repository contains a simple calculator application built using Windows Forms in C#. The calculator supports basic arithmetic operations and has features for evaluating complex expressions with parentheses and handling square root operations.","archived":false,"fork":false,"pushed_at":"2024-06-19T20:36:38.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T09:51:25.554Z","etag":null,"topics":["application","calculator","calculator-application","csharp","desktop-application","dotnet","wpf"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anlbora.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-19T20:19:17.000Z","updated_at":"2024-06-19T20:38:42.000Z","dependencies_parsed_at":"2024-06-20T09:42:13.686Z","dependency_job_id":"a31d754b-2c24-4b4a-b50d-02cc8ec60e7b","html_url":"https://github.com/anlbora/Calculator-WPF-NET","commit_stats":null,"previous_names":["anlbora/calculator-wpf-net"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anlbora%2FCalculator-WPF-NET","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anlbora%2FCalculator-WPF-NET/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anlbora%2FCalculator-WPF-NET/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anlbora%2FCalculator-WPF-NET/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anlbora","download_url":"https://codeload.github.com/anlbora/Calculator-WPF-NET/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247819947,"owners_count":21001394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["application","calculator","calculator-application","csharp","desktop-application","dotnet","wpf"],"created_at":"2024-09-27T02:42:36.320Z","updated_at":"2026-01-21T02:31:49.040Z","avatar_url":"https://github.com/anlbora.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Windows Forms Calculator Application\n\n## Overview\n\nThis repository contains a simple calculator application built using Windows Forms in C#. The calculator supports basic arithmetic operations and has features for evaluating complex expressions with parentheses and handling square root operations.\n\n![1](https://github.com/anlbora/Calculator-WPF-NET/assets/100442507/c069538a-863f-499f-9e54-0ef7cdbd8988)\n\n## Features\n\n- **Basic Arithmetic**: Supports addition, subtraction, multiplication, and division.\n- **Complex Expressions**: Allows for multiple operations and parentheses for operator precedence.\n- **Square Root Calculation**: Can compute the square root of the current input or the result displayed.\n- **Dynamic Display**: Adjusts the font size dynamically to fit longer expressions in the display.\n- **Keyboard Support**: Allows numeric and operation input via the keyboard.\n\n  ![2](https://github.com/anlbora/Calculator-WPF-NET/assets/100442507/926f6b28-0e5e-4247-9368-8656391bac8b)\n\n## Components\n\n### Main Form (`mainApp`)\n\n- **Controls**: The form includes buttons for digits (0-9), arithmetic operations (`+`, `-`, `*`, `/`), special functions (square root, parentheses, clear, delete, and toggle sign), and equal for evaluating the expression.\n- **Label**: `lbl_answer` displays the current input or result, dynamically adjusting its font size based on the length of the text.\n\n### Key Functionalities\n\n1. **Numeric Input**:\n    - Handled through both button clicks and keyboard input.\n    - Appended to the current `input` and reflected in the `expression` for display.\n\n2. **Operation Handling**:\n    - Adds operation signs (`+`, `-`, `*`, `/`) to the `expression`.\n    - Supports continuation of operations after the equal button is pressed.\n\n   ![3](https://github.com/anlbora/Calculator-WPF-NET/assets/100442507/83b8ec52-cb64-4aec-b8fa-414f3c6a7398)\n\n   ![4](https://github.com/anlbora/Calculator-WPF-NET/assets/100442507/230fd0c3-3823-49aa-a759-805d1627ae60)\n\n4. **Expression Evaluation**:\n    - Uses the `DataTable.Compute` method to evaluate the full expression, considering operator precedence and parentheses.\n    - Updates the `expression` to display the result after evaluation.\n\n5. **Square Root Calculation**:\n    - Computes the square root of the current input or the displayed result if no new input is provided.\n    - Updates the `expression` to reflect the square root operation result.\n\n6. **Dynamic Font Adjustment**:\n    - Adjusts the font size of `lbl_answer` based on the length of the text to ensure readability.\n\n7. **Keyboard Input Handling**:\n    - Supports numeric input and operations through keyboard shortcuts.\n    - Allows users to control the calculator without using the mouse.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanlbora%2Fcalculator-wpf-net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanlbora%2Fcalculator-wpf-net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanlbora%2Fcalculator-wpf-net/lists"}