1>c:\users\sophia\documents\visual studio 2010\projects\final\final\Form1.h(206): error C2440: '=' : cannot convert from 'System::Double ^' to 'System::Windows::Forms::TextBox ^'
No user-defined-conversion operator available, or
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
I was told to use wchar_t to convert it and it worked in one spot of the code but it is not working in this part - can someone tell me what I am doing wrong?
Expand|Select|Wrap|Line Numbers
- {
- wchar_t convertDuration;
- convertDuration = System::Convert::ToChar(txtDuration->Text);
- if(txtDuration->Text=="F" || txtDuration->Text=="f")
- txtCharge=whole[lstEquipment->SelectedIndex];
- else if(txtDuration->Text=="H" || txtDuration->Text=="h")
- txtCharge=half[lstEquipment->SelectedIndex];
- else
- MessageBox::Show("Incorrect letter entered");
- }
Expand|Select|Wrap|Line Numbers
- // txtCharge
- //
- this->txtCharge->Location = System::Drawing::Point(176, 176);
- this->txtCharge->Name = L"txtCharge";
- this->txtCharge->Size = System::Drawing::Size(86, 20);
- this->txtCharge->TabIndex = 5;
- //
Expand|Select|Wrap|Line Numbers
- // txtDuration
- //
- this->txtDuration->Location = System::Drawing::Point(228, 150);
- this->txtDuration->Name = L"txtDuration";
- this->txtDuration->Size = System::Drawing::Size(34, 20);
- this->txtDuration->TabIndex = 3;
- this->txtDuration->TextChanged += gcnew System::EventHandler(this, &Form1::Input_Duration);
- //
Expand|Select|Wrap|Line Numbers
- public ref class Form1 : public System::Windows::Forms::Form
- {
- private:static array <double^>^ half = gcnew[] = {16.0,12.0,20.0};
- private:static array <double^>^ whole = gcnew[] = {24.0,18.0,30.0};
- private:static array <String^>^ *equipment = gcnew[] = {"1- Rug Cleaner","2- Lawn Mower","3- Paint Sprayer"};