0

Ugh! need help.

Ok I am creating a form to calculate a conversion, actually one of 24 conversions to be decided by radio button.

I placed the code to make the conversion under the "checkchanged" event of each of the radio buttons, turns out that's not a good idea as the conversion will be made when the radio button is selected and not when the convert button is clicked.

So now my plan is to have the CONVERT button "click" event use a switch/case to process the conversion of each radio button case. I would like the "case" to be determined by which radio button is selected, so that if "radiobtn1" is selected it passes a value back to the CONVERT button click event, say number 1. Whereas if radiobtn2 is selected it will pass back value 2.

Yet, every time I attempt o send any kind of value to a variable it says it is undefined or it breaks out with an error saying I am using an incorrect namespace even though i haven't changed anything regarding the namespace.

I will post the entire code, and then I will post the two sections of code I am having difficulty with. I highlighted the sections of code that are driving me crazy.

#pragma once

namespace conversion1 {

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;
	
	/// <summary>
	/// Summary for Form1
	/// </summary>
	public ref class Form1 : public System::Windows::Forms::Form
	{
	public:
		Form1(void)
		{
			InitializeComponent();
			//
			//TODO: Add the constructor code here
			//
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~Form1()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::GroupBox^  groupBox1;
	protected: 
	private: System::Windows::Forms::GroupBox^  grpMass;
	private: System::Windows::Forms::RadioButton^  rbKg2Tn;
	private: System::Windows::Forms::RadioButton^  rbTn2Kg;
	private: System::Windows::Forms::RadioButton^  rbKg2Lb;
	private: System::Windows::Forms::RadioButton^  rbLb2Kg;
	private: System::Windows::Forms::RadioButton^  rbGm2Oz;
	private: System::Windows::Forms::RadioButton^  rbOz2Gm;
	private: System::Windows::Forms::GroupBox^  grpVol;
	private: System::Windows::Forms::RadioButton^  rbLt2Gal;
	private: System::Windows::Forms::RadioButton^  rbGal2Lt;
	private: System::Windows::Forms::RadioButton^  rbLt2Qt;
	private: System::Windows::Forms::RadioButton^  rbQt2Lt;
	private: System::Windows::Forms::RadioButton^  rbMl2Oz;
	private: System::Windows::Forms::RadioButton^  rbOz2Ml;
	private: System::Windows::Forms::GroupBox^  grpDist;
	private: System::Windows::Forms::RadioButton^  rbKm2Mi;
	private: System::Windows::Forms::RadioButton^  rbMi2Km;
	private: System::Windows::Forms::RadioButton^  rbFt2Mt;
	private: System::Windows::Forms::RadioButton^  rbMt2Ft;
	private: System::Windows::Forms::RadioButton^  reCm2In;
	private: System::Windows::Forms::RadioButton^  rbIn2Cm;
	private: System::Windows::Forms::GroupBox^  grpTemp;








	private: System::Windows::Forms::RadioButton^  rbCel2Kel;
	private: System::Windows::Forms::RadioButton^  rbRan2Fah;
	private: System::Windows::Forms::RadioButton^  rbFah2Ran;
	private: System::Windows::Forms::RadioButton^  rbCel2Fah;
	private: System::Windows::Forms::RadioButton^  rbFah2Cel;
	private: System::Windows::Forms::GroupBox^  groupBox2;
	private: System::Windows::Forms::RadioButton^  RbMass;
	private: System::Windows::Forms::RadioButton^  RbVol;
	private: System::Windows::Forms::RadioButton^  RbDist;
	private: System::Windows::Forms::RadioButton^  RbTemp;
	private: System::Windows::Forms::Button^  btnConvert;
	private: System::Windows::Forms::Button^  btnClear;
	private: System::Windows::Forms::Button^  btnExit;
	private: System::Windows::Forms::Label^  label1;
	private: System::Windows::Forms::Label^  lblconvertValue;

	private: System::Windows::Forms::TextBox^  txtInsVal;

	private: System::Windows::Forms::Label^  lblValue;
	private: System::Windows::Forms::RadioButton^  rbKel2Cel;
	private: System::Windows::Forms::Label^  label2;

	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>
		System::ComponentModel::Container ^components;

		private: System::Void label2_Click(System::Object^  sender, System::EventArgs^  e) {
		}
#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
			this->grpMass = (gcnew System::Windows::Forms::GroupBox());
			this->rbKg2Tn = (gcnew System::Windows::Forms::RadioButton());
			this->rbTn2Kg = (gcnew System::Windows::Forms::RadioButton());
			this->rbKg2Lb = (gcnew System::Windows::Forms::RadioButton());
			this->rbLb2Kg = (gcnew System::Windows::Forms::RadioButton());
			this->rbGm2Oz = (gcnew System::Windows::Forms::RadioButton());
			this->rbOz2Gm = (gcnew System::Windows::Forms::RadioButton());
			this->grpVol = (gcnew System::Windows::Forms::GroupBox());
			this->rbLt2Gal = (gcnew System::Windows::Forms::RadioButton());
			this->rbGal2Lt = (gcnew System::Windows::Forms::RadioButton());
			this->rbLt2Qt = (gcnew System::Windows::Forms::RadioButton());
			this->rbQt2Lt = (gcnew System::Windows::Forms::RadioButton());
			this->rbMl2Oz = (gcnew System::Windows::Forms::RadioButton());
			this->rbOz2Ml = (gcnew System::Windows::Forms::RadioButton());
			this->lblconvertValue = (gcnew System::Windows::Forms::Label());
			this->grpDist = (gcnew System::Windows::Forms::GroupBox());
			this->rbKm2Mi = (gcnew System::Windows::Forms::RadioButton());
			this->rbMi2Km = (gcnew System::Windows::Forms::RadioButton());
			this->rbFt2Mt = (gcnew System::Windows::Forms::RadioButton());
			this->rbMt2Ft = (gcnew System::Windows::Forms::RadioButton());
			this->reCm2In = (gcnew System::Windows::Forms::RadioButton());
			this->rbIn2Cm = (gcnew System::Windows::Forms::RadioButton());
			this->grpTemp = (gcnew System::Windows::Forms::GroupBox());
			this->rbKel2Cel = (gcnew System::Windows::Forms::RadioButton());
			this->rbCel2Kel = (gcnew System::Windows::Forms::RadioButton());
			this->rbRan2Fah = (gcnew System::Windows::Forms::RadioButton());
			this->rbFah2Ran = (gcnew System::Windows::Forms::RadioButton());
			this->rbCel2Fah = (gcnew System::Windows::Forms::RadioButton());
			this->rbFah2Cel = (gcnew System::Windows::Forms::RadioButton());
			this->groupBox2 = (gcnew System::Windows::Forms::GroupBox());
			this->RbMass = (gcnew System::Windows::Forms::RadioButton());
			this->RbVol = (gcnew System::Windows::Forms::RadioButton());
			this->RbDist = (gcnew System::Windows::Forms::RadioButton());
			this->RbTemp = (gcnew System::Windows::Forms::RadioButton());
			this->btnConvert = (gcnew System::Windows::Forms::Button());
			this->btnClear = (gcnew System::Windows::Forms::Button());
			this->btnExit = (gcnew System::Windows::Forms::Button());
			this->label1 = (gcnew System::Windows::Forms::Label());
			this->txtInsVal = (gcnew System::Windows::Forms::TextBox());
			this->lblValue = (gcnew System::Windows::Forms::Label());
			this->label2 = (gcnew System::Windows::Forms::Label());
			this->groupBox1->SuspendLayout();
			this->grpMass->SuspendLayout();
			this->grpVol->SuspendLayout();
			this->grpDist->SuspendLayout();
			this->grpTemp->SuspendLayout();
			this->groupBox2->SuspendLayout();
			this->SuspendLayout();
			// 
			// groupBox1
			// 
			this->groupBox1->Controls->Add(this->grpMass);
			this->groupBox1->Controls->Add(this->grpVol);
			this->groupBox1->Controls->Add(this->lblconvertValue);
			this->groupBox1->Controls->Add(this->grpDist);
			this->groupBox1->Controls->Add(this->grpTemp);
			this->groupBox1->Controls->Add(this->groupBox2);
			this->groupBox1->Location = System::Drawing::Point(3, 69);
			this->groupBox1->Margin = System::Windows::Forms::Padding(4);
			this->groupBox1->Name = L"groupBox1";
			this->groupBox1->Padding = System::Windows::Forms::Padding(4);
			this->groupBox1->Size = System::Drawing::Size(850, 366);
			this->groupBox1->TabIndex = 0;
			this->groupBox1->TabStop = false;
			// 
			// grpMass
			// 
			this->grpMass->Controls->Add(this->rbKg2Tn);
			this->grpMass->Controls->Add(this->rbTn2Kg);
			this->grpMass->Controls->Add(this->rbKg2Lb);
			this->grpMass->Controls->Add(this->rbLb2Kg);
			this->grpMass->Controls->Add(this->rbGm2Oz);
			this->grpMass->Controls->Add(this->rbOz2Gm);
			this->grpMass->Enabled = false;
			this->grpMass->Location = System::Drawing::Point(623, 105);
			this->grpMass->Margin = System::Windows::Forms::Padding(4);
			this->grpMass->Name = L"grpMass";
			this->grpMass->Padding = System::Windows::Forms::Padding(4);
			this->grpMass->Size = System::Drawing::Size(205, 228);
			this->grpMass->TabIndex = 6;
			this->grpMass->TabStop = false;
			this->grpMass->Text = L"Conversion Factor";
			// 
			// rbKg2Tn
			// 
			this->rbKg2Tn->AutoSize = true;
			this->rbKg2Tn->Location = System::Drawing::Point(11, 190);
			this->rbKg2Tn->Margin = System::Windows::Forms::Padding(4);
			this->rbKg2Tn->Name = L"rbKg2Tn";
			this->rbKg2Tn->Size = System::Drawing::Size(155, 21);
			this->rbKg2Tn->TabIndex = 5;
			this->rbKg2Tn->TabStop = true;
			this->rbKg2Tn->Text = L"Killogram to US Ton";
			this->rbKg2Tn->UseVisualStyleBackColor = true;
			this->rbKg2Tn->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbKg2Tn_CheckedChanged);
			// 
			// rbTn2Kg
			// 
			this->rbTn2Kg->AutoSize = true;
			this->rbTn2Kg->Location = System::Drawing::Point(11, 160);
			this->rbTn2Kg->Margin = System::Windows::Forms::Padding(4);
			this->rbTn2Kg->Name = L"rbTn2Kg";
			this->rbTn2Kg->Size = System::Drawing::Size(159, 21);
			this->rbTn2Kg->TabIndex = 4;
			this->rbTn2Kg->TabStop = true;
			this->rbTn2Kg->Text = L"US Ton to Kilograms";
			this->rbTn2Kg->UseVisualStyleBackColor = true;
			this->rbTn2Kg->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbTn2Kg_CheckedChanged);
			// 
			// rbKg2Lb
			// 
			this->rbKg2Lb->AutoSize = true;
			this->rbKg2Lb->Location = System::Drawing::Point(11, 130);
			this->rbKg2Lb->Margin = System::Windows::Forms::Padding(4);
			this->rbKg2Lb->Name = L"rbKg2Lb";
			this->rbKg2Lb->Size = System::Drawing::Size(185, 21);
			this->rbKg2Lb->TabIndex = 3;
			this->rbKg2Lb->TabStop = true;
			this->rbKg2Lb->Text = L"Killograms to US Pounds";
			this->rbKg2Lb->UseVisualStyleBackColor = true;
			this->rbKg2Lb->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbKg2Lb_CheckedChanged);
			// 
			// rbLb2Kg
			// 
			this->rbLb2Kg->AutoSize = true;
			this->rbLb2Kg->Location = System::Drawing::Point(11, 101);
			this->rbLb2Kg->Margin = System::Windows::Forms::Padding(4);
			this->rbLb2Kg->Name = L"rbLb2Kg";
			this->rbLb2Kg->Size = System::Drawing::Size(186, 21);
			this->rbLb2Kg->TabIndex = 2;
			this->rbLb2Kg->TabStop = true;
			this->rbLb2Kg->Text = L"US Pounds to Kilograms ";
			this->rbLb2Kg->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
			this->rbLb2Kg->UseVisualStyleBackColor = true;
			this->rbLb2Kg->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbLb2Kg_CheckedChanged);
			// 
			// rbGm2Oz
			// 
			this->rbGm2Oz->AutoSize = true;
			this->rbGm2Oz->Location = System::Drawing::Point(11, 71);
			this->rbGm2Oz->Margin = System::Windows::Forms::Padding(4);
			this->rbGm2Oz->Name = L"rbGm2Oz";
			this->rbGm2Oz->Size = System::Drawing::Size(140, 21);
			this->rbGm2Oz->TabIndex = 1;
			this->rbGm2Oz->TabStop = true;
			this->rbGm2Oz->Text = L"Grams to Ounces";
			this->rbGm2Oz->UseVisualStyleBackColor = true;
			this->rbGm2Oz->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbGm2Oz_CheckedChanged);
			// 
			// rbOz2Gm
			// 
			this->rbOz2Gm->AutoSize = true;
			this->rbOz2Gm->Location = System::Drawing::Point(11, 42);
			this->rbOz2Gm->Margin = System::Windows::Forms::Padding(4);
			this->rbOz2Gm->Name = L"rbOz2Gm";
			this->rbOz2Gm->Size = System::Drawing::Size(140, 21);
			this->rbOz2Gm->TabIndex = 0;
			this->rbOz2Gm->TabStop = true;
			this->rbOz2Gm->Text = L"Ounces to Grams";
			this->rbOz2Gm->UseVisualStyleBackColor = true;
			this->rbOz2Gm->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbOz2Gm_CheckedChanged);
			// 
			// grpVol
			// 
			this->grpVol->Controls->Add(this->rbLt2Gal);
			this->grpVol->Controls->Add(this->rbGal2Lt);
			this->grpVol->Controls->Add(this->rbLt2Qt);
			this->grpVol->Controls->Add(this->rbQt2Lt);
			this->grpVol->Controls->Add(this->rbMl2Oz);
			this->grpVol->Controls->Add(this->rbOz2Ml);
			this->grpVol->Enabled = false;
			this->grpVol->Location = System::Drawing::Point(387, 105);
			this->grpVol->Margin = System::Windows::Forms::Padding(4);
			this->grpVol->Name = L"grpVol";
			this->grpVol->Padding = System::Windows::Forms::Padding(4);
			this->grpVol->Size = System::Drawing::Size(234, 228);
			this->grpVol->TabIndex = 5;
			this->grpVol->TabStop = false;
			this->grpVol->Text = L"Conversion Factor";
			// 
			// rbLt2Gal
			// 
			this->rbLt2Gal->AutoSize = true;
			this->rbLt2Gal->Location = System::Drawing::Point(12, 190);
			this->rbLt2Gal->Margin = System::Windows::Forms::Padding(4);
			this->rbLt2Gal->Name = L"rbLt2Gal";
			this->rbLt2Gal->Size = System::Drawing::Size(155, 21);
			this->rbLt2Gal->TabIndex = 5;
			this->rbLt2Gal->TabStop = true;
			this->rbLt2Gal->Text = L"Liters to US Gallons";
			this->rbLt2Gal->UseVisualStyleBackColor = true;
			this->rbLt2Gal->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbLt2Gal_CheckedChanged);
			// 
			// rbGal2Lt
			// 
			this->rbGal2Lt->AutoSize = true;
			this->rbGal2Lt->Location = System::Drawing::Point(12, 160);
			this->rbGal2Lt->Margin = System::Windows::Forms::Padding(4);
			this->rbGal2Lt->Name = L"rbGal2Lt";
			this->rbGal2Lt->Size = System::Drawing::Size(148, 21);
			this->rbGal2Lt->TabIndex = 4;
			this->rbGal2Lt->TabStop = true;
			this->rbGal2Lt->Text = L"US Gallons to Liter";
			this->rbGal2Lt->UseVisualStyleBackColor = true;
			this->rbGal2Lt->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbGal2Lt_CheckedChanged);
			// 
			// rbLt2Qt
			// 
			this->rbLt2Qt->AutoSize = true;
			this->rbLt2Qt->Location = System::Drawing::Point(12, 130);
			this->rbLt2Qt->Margin = System::Windows::Forms::Padding(4);
			this->rbLt2Qt->Name = L"rbLt2Qt";
			this->rbLt2Qt->Size = System::Drawing::Size(150, 21);
			this->rbLt2Qt->TabIndex = 3;
			this->rbLt2Qt->TabStop = true;
			this->rbLt2Qt->Text = L"Liters to US Quarts";
			this->rbLt2Qt->UseVisualStyleBackColor = true;
			this->rbLt2Qt->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbLt2Qt_CheckedChanged);
			// 
			// rbQt2Lt
			// 
			this->rbQt2Lt->AutoSize = true;
			this->rbQt2Lt->Location = System::Drawing::Point(12, 101);
			this->rbQt2Lt->Margin = System::Windows::Forms::Padding(4);
			this->rbQt2Lt->Name = L"rbQt2Lt";
			this->rbQt2Lt->Size = System::Drawing::Size(150, 21);
			this->rbQt2Lt->TabIndex = 2;
			this->rbQt2Lt->TabStop = true;
			this->rbQt2Lt->Text = L"US Quarts to Liters";
			this->rbQt2Lt->UseVisualStyleBackColor = true;
			this->rbQt2Lt->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbQt2Lt_CheckedChanged);
			// 
			// rbMl2Oz
			// 
			this->rbMl2Oz->AutoSize = true;
			this->rbMl2Oz->Location = System::Drawing::Point(12, 71);
			this->rbMl2Oz->Margin = System::Windows::Forms::Padding(4);
			this->rbMl2Oz->Name = L"rbMl2Oz";
			this->rbMl2Oz->Size = System::Drawing::Size(205, 21);
			this->rbMl2Oz->TabIndex = 1;
			this->rbMl2Oz->TabStop = true;
			this->rbMl2Oz->Text = L"Milliliters to US Fluid ounces";
			this->rbMl2Oz->UseVisualStyleBackColor = true;
			this->rbMl2Oz->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbMl2Oz_CheckedChanged);
			// 
			// rbOz2Ml
			// 
			this->rbOz2Ml->AutoSize = true;
			this->rbOz2Ml->Location = System::Drawing::Point(12, 42);
			this->rbOz2Ml->Margin = System::Windows::Forms::Padding(4);
			this->rbOz2Ml->Name = L"rbOz2Ml";
			this->rbOz2Ml->Size = System::Drawing::Size(209, 21);
			this->rbOz2Ml->TabIndex = 0;
			this->rbOz2Ml->TabStop = true;
			this->rbOz2Ml->Text = L"US  Fluid ounces to Milliliters";
			this->rbOz2Ml->UseVisualStyleBackColor = true;
			this->rbOz2Ml->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbOz2Ml_CheckedChanged);
			// 
			// lblconvertValue
			// 
			this->lblconvertValue->BackColor = System::Drawing::SystemColors::ControlLightLight;
			this->lblconvertValue->Location = System::Drawing::Point(695, -16);
			this->lblconvertValue->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
			this->lblconvertValue->Name = L"lblconvertValue";
			this->lblconvertValue->Size = System::Drawing::Size(133, 24);
			this->lblconvertValue->TabIndex = 5;
			this->lblconvertValue->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
			this->lblconvertValue->Visible = false;
			// 
			// grpDist
			// 
			this->grpDist->Controls->Add(this->rbKm2Mi);
			this->grpDist->Controls->Add(this->rbMi2Km);
			this->grpDist->Controls->Add(this->rbFt2Mt);
			this->grpDist->Controls->Add(this->rbMt2Ft);
			this->grpDist->Controls->Add(this->reCm2In);
			this->grpDist->Controls->Add(this->rbIn2Cm);
			this->grpDist->Enabled = false;
			this->grpDist->Location = System::Drawing::Point(194, 105);
			this->grpDist->Margin = System::Windows::Forms::Padding(4);
			this->grpDist->Name = L"grpDist";
			this->grpDist->Padding = System::Windows::Forms::Padding(4);
			this->grpDist->Size = System::Drawing::Size(192, 228);
			this->grpDist->TabIndex = 4;
			this->grpDist->TabStop = false;
			this->grpDist->Text = L"Conversion Factor";
			// 
			// rbKm2Mi
			// 
			this->rbKm2Mi->AutoSize = true;
			this->rbKm2Mi->Location = System::Drawing::Point(14, 190);
			this->rbKm2Mi->Margin = System::Windows::Forms::Padding(4);
			this->rbKm2Mi->Name = L"rbKm2Mi";
			this->rbKm2Mi->Size = System::Drawing::Size(147, 21);
			this->rbKm2Mi->TabIndex = 5;
			this->rbKm2Mi->TabStop = true;
			this->rbKm2Mi->Text = L"Kilometers to Miles";
			this->rbKm2Mi->UseVisualStyleBackColor = true;
			this->rbKm2Mi->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbKm2Mi_CheckedChanged);
			// 
			// rbMi2Km
			// 
			this->rbMi2Km->AutoSize = true;
			this->rbMi2Km->Location = System::Drawing::Point(14, 160);
			this->rbMi2Km->Margin = System::Windows::Forms::Padding(4);
			this->rbMi2Km->Name = L"rbMi2Km";
			this->rbMi2Km->Size = System::Drawing::Size(147, 21);
			this->rbMi2Km->TabIndex = 4;
			this->rbMi2Km->TabStop = true;
			this->rbMi2Km->Text = L"Miles to Kilometers";
			this->rbMi2Km->UseVisualStyleBackColor = true;
			this->rbMi2Km->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbMi2Km_CheckedChanged);
			// 
			// rbFt2Mt
			// 
			this->rbFt2Mt->AutoSize = true;
			this->rbFt2Mt->Location = System::Drawing::Point(14, 130);
			this->rbFt2Mt->Margin = System::Windows::Forms::Padding(4);
			this->rbFt2Mt->Name = L"rbFt2Mt";
			this->rbFt2Mt->Size = System::Drawing::Size(120, 21);
			this->rbFt2Mt->TabIndex = 3;
			this->rbFt2Mt->TabStop = true;
			this->rbFt2Mt->Text = L"Feet to Meters";
			this->rbFt2Mt->UseVisualStyleBackColor = true;
			this->rbFt2Mt->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbFt2Mt_CheckedChanged);
			// 
			// rbMt2Ft
			// 
			this->rbMt2Ft->AutoSize = true;
			this->rbMt2Ft->Location = System::Drawing::Point(14, 101);
			this->rbMt2Ft->Margin = System::Windows::Forms::Padding(4);
			this->rbMt2Ft->Name = L"rbMt2Ft";
			this->rbMt2Ft->Size = System::Drawing::Size(120, 21);
			this->rbMt2Ft->TabIndex = 2;
			this->rbMt2Ft->TabStop = true;
			this->rbMt2Ft->Text = L"Meters to Feet";
			this->rbMt2Ft->UseVisualStyleBackColor = true;
			this->rbMt2Ft->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbMt2Ft_CheckedChanged);
			// 
			// reCm2In
			// 
			this->reCm2In->AutoSize = true;
			this->reCm2In->Location = System::Drawing::Point(14, 71);
			this->reCm2In->Margin = System::Windows::Forms::Padding(4);
			this->reCm2In->Name = L"reCm2In";
			this->reCm2In->Size = System::Drawing::Size(165, 21);
			this->reCm2In->TabIndex = 1;
			this->reCm2In->TabStop = true;
			this->reCm2In->Text = L"Centimeters to Inches";
			this->reCm2In->UseVisualStyleBackColor = true;
			this->reCm2In->CheckedChanged += gcnew System::EventHandler(this, &Form1::reCm2In_CheckedChanged);
			// 
			// rbIn2Cm
			// 
			this->rbIn2Cm->AutoSize = true;
			this->rbIn2Cm->Location = System::Drawing::Point(14, 42);
			this->rbIn2Cm->Margin = System::Windows::Forms::Padding(4);
			this->rbIn2Cm->Name = L"rbIn2Cm";
			this->rbIn2Cm->Size = System::Drawing::Size(165, 21);
			this->rbIn2Cm->TabIndex = 0;
			this->rbIn2Cm->TabStop = true;
			this->rbIn2Cm->Text = L"Inches to Centimeters";
			this->rbIn2Cm->UseVisualStyleBackColor = true;
			this->rbIn2Cm->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbIn2Cm_CheckedChanged);
			// 
			// grpTemp
			// 
			this->grpTemp->Controls->Add(this->rbKel2Cel);
			this->grpTemp->Controls->Add(this->rbCel2Kel);
			this->grpTemp->Controls->Add(this->rbRan2Fah);
			this->grpTemp->Controls->Add(this->rbFah2Ran);
			this->grpTemp->Controls->Add(this->rbCel2Fah);
			this->grpTemp->Controls->Add(this->rbFah2Cel);
			this->grpTemp->Enabled = false;
			this->grpTemp->Location = System::Drawing::Point(8, 105);
			this->grpTemp->Margin = System::Windows::Forms::Padding(4);
			this->grpTemp->Name = L"grpTemp";
			this->grpTemp->Padding = System::Windows::Forms::Padding(4);
			this->grpTemp->Size = System::Drawing::Size(187, 228);
			this->grpTemp->TabIndex = 0;
			this->grpTemp->TabStop = false;
			this->grpTemp->Text = L"Conversion Factor";
			// 
			// rbKel2Cel
			// 
			this->rbKel2Cel->AutoSize = true;
			this->rbKel2Cel->Location = System::Drawing::Point(12, 190);
			this->rbKel2Cel->Name = L"rbKel2Cel";
			this->rbKel2Cel->Size = System::Drawing::Size(132, 21);
			this->rbKel2Cel->TabIndex = 5;
			this->rbKel2Cel->TabStop = true;
			this->rbKel2Cel->Text = L"Kelvin to Celcius";
			this->rbKel2Cel->UseVisualStyleBackColor = true;
			this->rbKel2Cel->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbKel2Cel_CheckedChanged);
			// 
			// rbCel2Kel
			// 
			this->rbCel2Kel->AutoSize = true;
			this->rbCel2Kel->Location = System::Drawing::Point(12, 160);
			this->rbCel2Kel->Margin = System::Windows::Forms::Padding(4);
			this->rbCel2Kel->Name = L"rbCel2Kel";
			this->rbCel2Kel->Size = System::Drawing::Size(132, 21);
			this->rbCel2Kel->TabIndex = 4;
			this->rbCel2Kel->Text = L"Celcius to Kelvin";
			this->rbCel2Kel->UseVisualStyleBackColor = true;
			this->rbCel2Kel->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbCel2Kel_CheckedChanged);
			// 
			// rbRan2Fah
			// 
			this->rbRan2Fah->AutoSize = true;
			this->rbRan2Fah->Location = System::Drawing::Point(12, 130);
			this->rbRan2Fah->Margin = System::Windows::Forms::Padding(4);
			this->rbRan2Fah->Name = L"rbRan2Fah";
			this->rbRan2Fah->Size = System::Drawing::Size(161, 21);
			this->rbRan2Fah->TabIndex = 3;
			this->rbRan2Fah->Text = L"Rankin to Fahrenheit";
			this->rbRan2Fah->UseVisualStyleBackColor = true;
			this->rbRan2Fah->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbRan2Fah_CheckedChanged);
			// 
			// rbFah2Ran
			// 
			this->rbFah2Ran->AutoSize = true;
			this->rbFah2Ran->Location = System::Drawing::Point(12, 101);
			this->rbFah2Ran->Margin = System::Windows::Forms::Padding(4);
			this->rbFah2Ran->Name = L"rbFah2Ran";
			this->rbFah2Ran->Size = System::Drawing::Size(161, 21);
			this->rbFah2Ran->TabIndex = 2;
			this->rbFah2Ran->Text = L"Fahrenheit to Rankin";
			this->rbFah2Ran->UseVisualStyleBackColor = true;
			this->rbFah2Ran->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbFah2Ran_CheckedChanged);
			// 
			// rbCel2Fah
			// 
			this->rbCel2Fah->AutoSize = true;
			this->rbCel2Fah->Location = System::Drawing::Point(12, 71);
			this->rbCel2Fah->Margin = System::Windows::Forms::Padding(4);
			this->rbCel2Fah->Name = L"rbCel2Fah";
			this->rbCel2Fah->Size = System::Drawing::Size(162, 21);
			this->rbCel2Fah->TabIndex = 1;
			this->rbCel2Fah->Text = L"Celcius to Fahrenheit";
			this->rbCel2Fah->UseVisualStyleBackColor = true;
			this->rbCel2Fah->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbCel2Fah_CheckedChanged);
			// 
			// rbFah2Cel
			// 
			this->rbFah2Cel->AutoSize = true;
			this->rbFah2Cel->Location = System::Drawing::Point(12, 43);
			this->rbFah2Cel->Margin = System::Windows::Forms::Padding(4);
			this->rbFah2Cel->Name = L"rbFah2Cel";
			this->rbFah2Cel->Size = System::Drawing::Size(162, 21);
			this->rbFah2Cel->TabIndex = 0;
			this->rbFah2Cel->Text = L"Fahrenheit to Celcius";
			this->rbFah2Cel->UseVisualStyleBackColor = true;
			this->rbFah2Cel->CheckedChanged += gcnew System::EventHandler(this, &Form1::rbFah2Cel_CheckedChanged);
			// 
			// groupBox2
			// 
			this->groupBox2->Controls->Add(this->RbMass);
			this->groupBox2->Controls->Add(this->RbVol);
			this->groupBox2->Controls->Add(this->RbDist);
			this->groupBox2->Controls->Add(this->RbTemp);
			this->groupBox2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->groupBox2->Location = System::Drawing::Point(13, 23);
			this->groupBox2->Margin = System::Windows::Forms::Padding(4);
			this->groupBox2->Name = L"groupBox2";
			this->groupBox2->Padding = System::Windows::Forms::Padding(4);
			this->groupBox2->Size = System::Drawing::Size(791, 58);
			this->groupBox2->TabIndex = 0;
			this->groupBox2->TabStop = false;
			this->groupBox2->Text = L"Conversion Type";
			// 
			// RbMass
			// 
			this->RbMass->AutoSize = true;
			this->RbMass->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->RbMass->Location = System::Drawing::Point(580, 23);
			this->RbMass->Margin = System::Windows::Forms::Padding(4);
			this->RbMass->Name = L"RbMass";
			this->RbMass->Size = System::Drawing::Size(75, 24);
			this->RbMass->TabIndex = 3;
			this->RbMass->Text = L"Mass";
			this->RbMass->UseVisualStyleBackColor = true;
			this->RbMass->CheckedChanged += gcnew System::EventHandler(this, &Form1::RbMass_CheckedChanged);
			// 
			// RbVol
			// 
			this->RbVol->AutoSize = true;
			this->RbVol->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->RbVol->Location = System::Drawing::Point(399, 23);
			this->RbVol->Margin = System::Windows::Forms::Padding(4);
			this->RbVol->Name = L"RbVol";
			this->RbVol->Size = System::Drawing::Size(92, 24);
			this->RbVol->TabIndex = 2;
			this->RbVol->Text = L"Volume";
			this->RbVol->UseVisualStyleBackColor = true;
			this->RbVol->CheckedChanged += gcnew System::EventHandler(this, &Form1::RbVol_CheckedChanged);
			// 
			// RbDist
			// 
			this->RbDist->AutoSize = true;
			this->RbDist->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->RbDist->Location = System::Drawing::Point(217, 23);
			this->RbDist->Margin = System::Windows::Forms::Padding(4);
			this->RbDist->Name = L"RbDist";
			this->RbDist->Size = System::Drawing::Size(105, 24);
			this->RbDist->TabIndex = 1;
			this->RbDist->Text = L"Distance";
			this->RbDist->UseVisualStyleBackColor = true;
			this->RbDist->CheckedChanged += gcnew System::EventHandler(this, &Form1::RbDist_CheckedChanged);
			// 
			// RbTemp
			// 
			this->RbTemp->AutoSize = true;
			this->RbTemp->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->RbTemp->Location = System::Drawing::Point(32, 23);
			this->RbTemp->Margin = System::Windows::Forms::Padding(4);
			this->RbTemp->Name = L"RbTemp";
			this->RbTemp->Size = System::Drawing::Size(142, 24);
			this->RbTemp->TabIndex = 0;
			this->RbTemp->Text = L"Temperature ";
			this->RbTemp->UseVisualStyleBackColor = true;
			this->RbTemp->CheckedChanged += gcnew System::EventHandler(this, &Form1::RbTemp_CheckedChanged);
			// 
			// btnConvert
			// 
			this->btnConvert->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->btnConvert->Location = System::Drawing::Point(98, 457);
			this->btnConvert->Margin = System::Windows::Forms::Padding(4);
			this->btnConvert->Name = L"btnConvert";
			this->btnConvert->Size = System::Drawing::Size(100, 28);
			this->btnConvert->TabIndex = 1;
			this->btnConvert->Text = L"Convert";
			this->btnConvert->UseVisualStyleBackColor = true;
			this->btnConvert->Click += gcnew System::EventHandler(this, &Form1::btnConvert_Click);
			// 
			// btnClear
			// 
			this->btnClear->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->btnClear->Location = System::Drawing::Point(363, 457);
			this->btnClear->Margin = System::Windows::Forms::Padding(4);
			this->btnClear->Name = L"btnClear";
			this->btnClear->Size = System::Drawing::Size(100, 28);
			this->btnClear->TabIndex = 2;
			this->btnClear->Text = L"Clear";
			this->btnClear->UseVisualStyleBackColor = true;
			// 
			// btnExit
			// 
			this->btnExit->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->btnExit->Location = System::Drawing::Point(610, 457);
			this->btnExit->Margin = System::Windows::Forms::Padding(4);
			this->btnExit->Name = L"btnExit";
			this->btnExit->Size = System::Drawing::Size(100, 28);
			this->btnExit->TabIndex = 3;
			this->btnExit->Text = L"Exit";
			this->btnExit->UseVisualStyleBackColor = true;
			this->btnExit->Click += gcnew System::EventHandler(this, &Form1::btnExit_Click);
			// 
			// label1
			// 
			this->label1->AutoSize = true;
			this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10.2F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->label1->Location = System::Drawing::Point(406, 23);
			this->label1->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
			this->label1->Name = L"label1";
			this->label1->Size = System::Drawing::Size(147, 20);
			this->label1->TabIndex = 4;
			this->label1->Text = L"Converted Value";
			// 
			// txtInsVal
			// 
			this->txtInsVal->Location = System::Drawing::Point(225, 21);
			this->txtInsVal->Margin = System::Windows::Forms::Padding(4);
			this->txtInsVal->Name = L"txtInsVal";
			this->txtInsVal->Size = System::Drawing::Size(132, 22);
			this->txtInsVal->TabIndex = 7;
			this->txtInsVal->TextChanged += gcnew System::EventHandler(this, &Form1::txtInsVal_TextChanged);
			// 
			// lblValue
			// 
			this->lblValue->AutoSize = true;
			this->lblValue->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10.2F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->lblValue->Location = System::Drawing::Point(59, 23);
			this->lblValue->Name = L"lblValue";
			this->lblValue->Size = System::Drawing::Size(154, 20);
			this->lblValue->TabIndex = 9;
			this->lblValue->Text = L"Value To Convert";
			// 
			// label2
			// 
			this->label2->AutoSize = true;
			this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10.2F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->label2->Location = System::Drawing::Point(622, 21);
			this->label2->Name = L"label2";
			this->label2->Size = System::Drawing::Size(0, 20);
			this->label2->TabIndex = 10;
			this->label2->Visible = false;
			this->label2->Click += gcnew System::EventHandler(this, &Form1::label2_Click);
			// 
			// Form1
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(8, 16);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(858, 518);
			this->Controls->Add(this->label2);
			this->Controls->Add(this->lblValue);
			this->Controls->Add(this->txtInsVal);
			this->Controls->Add(this->label1);
			this->Controls->Add(this->btnExit);
			this->Controls->Add(this->btnClear);
			this->Controls->Add(this->btnConvert);
			this->Controls->Add(this->groupBox1);
			this->Margin = System::Windows::Forms::Padding(4);
			this->Name = L"Form1";
			this->Text = L"Form1";
			this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
			this->groupBox1->ResumeLayout(false);
			this->grpMass->ResumeLayout(false);
			this->grpMass->PerformLayout();
			this->grpVol->ResumeLayout(false);
			this->grpVol->PerformLayout();
			this->grpDist->ResumeLayout(false);
			this->grpDist->PerformLayout();
			this->grpTemp->ResumeLayout(false);
			this->grpTemp->PerformLayout();
			this->groupBox2->ResumeLayout(false);
			this->groupBox2->PerformLayout();
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion

		// Radio buttons for Conversion Factor

private: System::Void RbTemp_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
				 grpTemp->Enabled=true;
				 grpDist->Enabled=false;
				 grpVol->Enabled=false;
				 grpMass->Enabled=false;
				 }
private: System::Void RbDist_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			     grpTemp->Enabled=false;
				 grpDist->Enabled=true;
				 grpVol->Enabled=false;
				 grpMass->Enabled=false;
		 }
private: System::Void RbVol_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			     grpTemp->Enabled=false;
				 grpDist->Enabled=false;
				 grpVol->Enabled=true;
				 grpMass->Enabled=false;
		 }
private: System::Void RbMass_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			     grpTemp->Enabled=false;
				 grpDist->Enabled=false;
				 grpVol->Enabled=false;
				 grpMass->Enabled=true;
		 }


		 //Radio Buttons for Temp

private: System::Void rbFah2Cel_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)-32)*(5.0/9);
			 label2->Text= Convert::ToString(conversion);
		    

 // want to pass value from here to a switch case

		 }
private: System::Void rbCel2Fah_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)*(9/5.0))+32;
			 label2->Text= Convert::ToString(conversion);
		     
		 }
private: System::Void rbFah2Ran_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)+459.67);
			 label2->Text= Convert::ToString(conversion);
			 
			 
		 }
private: System::Void rbRan2Fah_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)-459.67);
			 label2->Text= Convert::ToString(conversion);
			 
			 
		 }
private: System::Void rbCel2Kel_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)+273.15);
			 label2->Text= Convert::ToString(conversion);
			 
			
		 }

private: System::Void rbKel2Cel_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)-273.15);
			 label2->Text= Convert::ToString(conversion);
			 
			
		 }





		 //Radio Buttons for Length

private: System::Void rbIn2Cm_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* 2.54);
			 label2->Text= Convert::ToString(conversion);
			 
		 }
private: System::Void reCm2In_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* .3937);
			 label2->Text= Convert::ToString(conversion);
			 
		 }
private: System::Void rbMt2Ft_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* 3.2808);
			 label2->Text= Convert::ToString(conversion);
			 
		 }
private: System::Void rbFt2Mt_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* .3048);
			 label2->Text= Convert::ToString(conversion);
			 
		 }
private: System::Void rbMi2Km_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* 1.6093);
			 label2->Text= Convert::ToString(conversion);
			 
		 }
private: System::Void rbKm2Mi_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* .6214);
			 label2->Text= Convert::ToString(conversion);
			 
		 }


		 //Radio Buttons for Volume

private: System::Void rbOz2Ml_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* 29.573529563);
			 label2->Text= Convert::ToString(conversion);
			 
		 }
private: System::Void rbMl2Oz_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* .033814022701 );
			 label2->Text= Convert::ToString(conversion);
			 
		 }
private: System::Void rbQt2Lt_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* .946352946);
			 label2->Text= Convert::ToString(conversion);
			 
		 }
private: System::Void rbLt2Qt_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* 1.0566882094);
			 label2->Text= Convert::ToString(conversion);
			 
		 }
private: System::Void rbGal2Lt_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* 3.785411784);
			 label2->Text= Convert::ToString(conversion);
			 
		 }
private: System::Void rbLt2Gal_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* 0.26417205236);
			 label2->Text= Convert::ToString(conversion);
			 
		 }

		 // Radio Buttons for Mass

private: System::Void rbOz2Gm_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* 28.349523125);
			 label2->Text= Convert::ToString(conversion);
			 
		 }
private: System::Void rbGm2Oz_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* 0.03527396195);
			 label2->Text= Convert::ToString(conversion);
			 
		 }
private: System::Void rbLb2Kg_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* 0.45359237);
			 label2->Text= Convert::ToString(conversion);
			 
		 }
private: System::Void rbKg2Lb_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* 2.2046226218);
			 label2->Text= Convert::ToString(conversion);
			 
		 }
private: System::Void rbTn2Kg_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* 907.18474);
			 label2->Text= Convert::ToString(conversion);
			 
		 }
private: System::Void rbKg2Tn_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)* 0.0011023113109);
			 label2->Text= Convert::ToString(conversion);
			 
		 }


//private: System::Void groupBox4_Enter(System::Object^  sender, System::EventArgs^  e) {
//		 }
private: System::Void txtInsVal_TextChanged(System::Object^  sender, System::EventArgs^  e) {
		
		 int txtTemp;
			if (Int32::TryParse(txtInsVal->Text, txtTemp))
					txtTemp = Convert::ToInt32(txtInsVal->Text);
		 
			else
				txtInsVal->Text = Convert::ToString(txtTemp);
		 
		 }

		 //I tried using a public variable
public: int chooseBtn()
	{ 
			
		return 1;
	}




		 //CONVERT BUTTON USING  SWITCH/CASE
private: System::Void btnConvert_Click(System::Object^  sender, System::EventArgs^  e) {
			 

		
	

		//// Switch/case

	/*	while (!done)
		{*/
			switch (&conversion1::Form1::chooseBtn)
			{
			case 1:      ;
		//	case 2:      ;
		//	case 3:      ;
		//	case 4:      ;
		//	case 5:      ;
		//	case 6:      ;
		//	case 7:      ;
		//	case 8:      ;
		//	case 9:      ;
		//	case 10:      ;
		//	case 11:      ;
		//	case 12:      ;
		//	case 13:      ;
		//	case 14:      ;
		//	case 15:      ;
		//	case 16:      ;
		//	case 17:      ;
		//	case 18:      ;
		//	case 19:      ;
		//	case 20:      ;
		//	case 21:      ;
		//	case 22:      ;
		//	case 23:      ;
		//	case 24:      ;
			
			}

















		}
private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
			
		 }

private: System::Void btnExit_Click(System::Object^  sender, System::EventArgs^  e) {
			 Application::Exit();
		 }
};
}

I wan't to pass a value from this code

private: System::Void rbFah2Cel_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
			 double convertValue= Convert::ToDouble(txtInsVal->Text);
			 double conversion=((convertValue)-32)*(5.0/9);
			 label2->Text= Convert::ToString(conversion);
		    

 // want to pass value from here to a switch case

}

To here

//CONVERT BUTTON USING  SWITCH/CASE
private: System::Void btnConvert_Click(System::Object^  sender, System::EventArgs^  e) {
			 

		
	

		//// Switch/case

	/*	while (!done)
		{*/
			switch (&conversion1::Form1::chooseBtn)
			{
			case 1:      ;
		//	case 2:      ;
		//	case 3:      ;
		//	case 4:      ;
		//	case 5:      ;
		//	case 6:      ;
		//	case 7:      ;
		//	case 8:      ;
		//	case 9:      ;
		//	case 10:      ;
		//	case 11:      ;
		//	case 12:      ;
		//	case 13:      ;
		//	case 14:      ;
		//	case 15:      ;
		//	case 16:      ;
		//	case 17:      ;
		//	case 18:      ;
		//	case 19:      ;
		//	case 20:      ;
		//	case 21:      ;
		//	case 22:      ;
		//	case 23:      ;
		//	case 24:      ;
			
			}
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by thines01
0

One thing that may be causing you a problem is you are tying-in the functioning conversion tightly with the display mechanism and that is causing you to create a lot of code.

Can you make a class that JUST does the conversions first?
After that, you can determine which events will call into the class.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.