Adding Functionality to Buttons

I am making a calculator in VC++ using CLR. How do I give buttons functionality?
A: I want to have each button add a number or operator to textbox1.
B: I am basing my button pad on a basic numpad for a keyboard (for now).
C: It has the following buttons other than 0 through 9: CE, +/-, C, /, X, -, +, =, and (.).

This is my current code for the "0" button.
1
2
3
4
#pragma endregion
	private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
				 //Something needs to go here. I just don't know what.
	}

Here is the code to (what I believe) declare button.
1
2
3
4
5
6
7
8
9
// button2
// 
this->button2->Location = System::Drawing::Point(12, 189);
this->button2->Name = L"button2";
this->button2->Size = System::Drawing::Size(62, 23);
this->button2->TabIndex = 1;
this->button2->Text = L"0";
this->button2->UseVisualStyleBackColor = true;
this->button2->Click += gcnew System::EventHandler(this, &Calculator::button2_Click);

And here is my .cpp file.
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "Calculator.h"

using namespace System;
using namespace System::Windows::Forms;

[STAThread]
void main(){
	Application::EnableVisualStyles();
	Application::SetCompatibleTextRenderingDefault(false);

	Calculator::Calculator form;
	Application::Run(%form);
}
didn't work on CLR for ages, but I think this works...
1
2
3
private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
				this->textbox1->Text  = "text";
	}
Topic archived. No new replies allowed.