Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C# Programming › Simple Calculator W/O Classes

Simple Calculator W/O Classes

Posts 1–12 of 12 · Page 1 of 1
DE
Dev_Pump
Simple Calculator W/O Classes
Description:
Small, Light weight application which allows you to "Add, Subtract, Multiply, Divide".

My Usage: I Really Don't Know, I have made Better ones.



Required Items:
Window Form (Only 1 Form.)
3 Labels
4 Text-boxes
4 Buttons
1 Windows Form

Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            Dev_Pump.Text = "Made By: Dev_Pump";
            Dev_Pump.ReadOnly = true;
        }
        private void Addition_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length == 0)
            {
                MessageBox.Show("You have not entered a number.");
            }
            else
            {
                //Calc values, Var
                int num1;
                int num2;
                float Answer;
                num1 = int.Parse(textBox1.Text);
                num2 = int.Parse(textBox2.Text);
                //Calc Add Start
                Answer = num1 + num2;
                textBox3.Text = Answer.ToString();
                SignL.Text = "+";
                ActionL.Text = "Action Used: Addition";
            }
        }

        private void Multiply_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length == 0)
            {
                MessageBox.Show("You have not entered a number.");
            }
            else
            {
                //Calc values, Var
                int num1;
                int num2;
                float Answer;
                num1 = int.Parse(textBox1.Text);
                num2 = int.Parse(textBox2.Text);
                //Calc MultiP Start
                Answer = num1 * num2;
                textBox3.Text = Answer.ToString();
                SignL.Text = "X";
                ActionL.Text = "Action Used: Multiplcation";
            }
        }

        private void Subtract_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length == 0)
            {
                MessageBox.Show("You have not entered a number.");
            }
            else
            {
                //Calc values, Var
                int num1;
                int num2;
                float Answer;
                num1 = int.Parse(textBox1.Text);
                num2 = int.Parse(textBox2.Text);
                //Calc SubT Start
                Answer = num1 - num2;
                textBox3.Text = Answer.ToString();
                SignL.Text = "-";
                ActionL.Text = "Action Used: Subtraction";
            }
        }

        private void Divide_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length == 0)
            {
             MessageBox.Show("You have not entered a number.");
            }
                if (textBox1.Text.StartsWith ("0"))
                {
                    MessageBox.Show("WTF?.");
                }
                if (textBox2.Text.StartsWith("0"))
                {
                    MessageBox.Show("WTF?.");
                }
            else
            {
                //Calc values, Var
                int num1;
                int num2;
                float Answer;
                num1 = int.Parse(textBox1.Text);
                num2 = int.Parse(textBox2.Text);
                //Calc SubT Start
                Answer = num1 / num2;
                textBox3.Text = Answer.ToString();
                SignL.Text = "/";
                ActionL.Text = "Action Used: Division";
            }
        }
        private void TBox1(object sender, EventArgs e)
        {
            textBox1.Text = " ";
        }

        private void TBox2(object sender, EventArgs e)
        {
            textBox2.Text = " ";
        }
    }
}
Virus Total Scan
#1 · 16y ago
kronus980
kronus980
I likes. Really good. Quick question: What is partial class? Is creating an object from it any different? And what's the point? Couldn't you just use a regular class? Just wondering. Please enlighten me
#2 · 16y ago
DE
Dev_Pump
Quote Originally Posted by kronus980 View Post
I likes. Really good. Quick question: What is partial class? Is creating an object from it any different? And what's the point? Couldn't you just use a regular class? Just wondering. Please enlighten me
I can't really explain what a partial class is. I have not added any classes in the program, I will be releasing one with A Class or two.

The Following is what Microsoft Visual Studio 2010 automatically places in beginning of the program code.

Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
#3 · 16y ago
kronus980
kronus980
Oh okay. Thanks though. If you find out, post please.
#4 · 16y ago
ZE
zeco
The partial keyword is used when the definition of a class is split over multiple source files. So basically then when you compile it, it combines all the different pieces of the class.
#5 · 16y ago
'Bruno
'Bruno
you guys should really look to google such simple stuff, not even need to google.. just go on msdn.

Partial Class Definitions (C#)

i'm giving you the link because that will explain it to you better then i would (im not a great teacher)

edit:

Quote Originally Posted by zeco View Post
The partial keyword is used when the definition of a class is split over multiple source files. So basically then when you compile it, it combines all the different pieces of the class.
you forgot something important... on the same namespace... thats the point
#6 · 16y ago
ZE
zeco
Quote Originally Posted by Brinuz View Post
you guys should really look to google such simple stuff, not even need to google.. just go on msdn.

Partial Class Definitions (C#)

i'm giving you the link because that will explain it to you better then i would (im not a great teacher)

edit:



you forgot something important... on the same namespace... thats the point
Well I had assumed that of course it would be the same namespace. . . Otherwise it wouldn't even be visible within scope, it just wouldn't make sense if it was a different namespace. . . .
#7 · 16y ago
'Bruno
'Bruno
Quote Originally Posted by zeco View Post
Well I had assumed that of course it would be the same namespace. . . Otherwise it wouldn't even be visible within scope, it just wouldn't make sense if it was a different namespace. . . .
but thats the whole point...
#8 · 16y ago
ZE
zeco
Quote Originally Posted by Brinuz View Post
but thats the whole point...
Sidenote: In your sig you spelled beginner incorrectly.
#9 · 16y ago
'Bruno
'Bruno
Quote Originally Posted by zeco View Post
Sidenote: In your sig you spelled beginner incorrectly.
i dont see how useful is that for this topic... but thanks anyway.
#10 · 16y ago
ZE
zeco
Quote Originally Posted by Brinuz View Post
i dont see how useful is that for this topic... but thanks anyway.
'Twasn't I'm just spammin' now.
#11 · 16y ago
KI
kilert
you are completly off-topic. chat with pm
#12 · 16y ago
Posts 1–12 of 12 · Page 1 of 1

Post a Reply

Similar Threads

  • Simple KDR CalculatorBy MvRouC12 in CrossFire Discussions
    14Last post 16y ago
  • [Tutorial]Simple class explanations[Stickied]By Ghost in World of Warcraft Tutorials
    20Last post 13y ago
  • [Source]Simple menu classBy Void in C++/C Programming
    44Last post 15y ago
  • Simple RS Calculator I made!!By iKeyLoggedU in RuneScape Discussions
    6Last post 15y ago
  • Simple MemoryMgr ClassBy CodeDemon in Combat Arms Hack Coding / Programming / Source Code
    21Last post 15y ago

Tags for this Thread

None