So im using visual basic C++ GUI (playing around) and started making a calculator.
So most of the code is in the .h file, I can put it here but its super long so I was wondering where do I place my classes.
In the .h file I tried putting the class before
#pragma endregion private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { Lblcalc->Text = "+"; }
but seem to get an error
Another question about classes
for my to display the number in the label I need to write this
private: System::Void Btn1_Click(System::Object^ sender, System::EventArgs^ e) { if (Lblcalc->Text == "0"){ Lblcalc->Text = "1"; } else { Lblcalc->Text = Convert::ToInt32(Lblcalc->Text) + "1"; }
but can i create a class and do this instead :
class numbers{ public: void num(); }; numbers::num(int x){ if (Lblcalc->Text == "0"){ Lblcalc->Text = x; }<var>else</var> { Lblcalc->Text = Convert::ToInt32(Lblcalc->Text) +x; }
then just do this :
private: System::Void Btn1_Click(System::Object^ sender, System::EventArgs^ e) { numbers one one.num(1) }