I have in a VS2005 C++ Form application a table adapter and a Text box that displays data from a specific column. What I want to do is to have its color changed on whether the content is >0 or <0. I tried adding this:
if(this->CSumTextBox->TabIndex<0)
{
this->CSumTextBox->ForeColor = System::Drawing::Color::Red;
}
But it doesn't work... (I didn't really believe TabIndex was the correct function, but it seemed the only one close) Help please
Edit: CSum is a double. Here is the whole code for CsumTextBox:
//
// CSumTextBox
//
this->CSumTextBox->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Left));
this->CSumTextBox->BackColor = System::Drawing::SystemColors::Window;
this->CSumTextBox->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->sumclosedpnlBindingSource, L"CSum", true)));
this->CSumTextBox->Location = System::Drawing::Point(214, 632);
this->CSumTextBox->Name = L"CSumTextBox";
this->CSumTextBox->Size = System::Drawing::Size(86, 20);
this->CSumTextBox->TabIndex = 7;
It is in the Form Header (the whole program is a GUI, so almost everything is in there...)
Edit: Maybe if I check the data binding source's Value it would work, but how can I do that?
(Does a this->sumclosedpnlBindingSource->returnvalue(CSum)
or something like that exist?)