I am trying to make something work but are not sure what I am doing wrong.
I have a comboBox where I will select an Item with the eventhandler below.
When I select an Item I want the messageBox to show a message Once but the message
is showing over and over again.
What I am after is that everytime I change Item in the comboBox1 the messageBox will appear once.
I am trying to save the comboBox->Text into a private: String for comparison but this does not seems to work. I don´t know if there could be any idéas.
private: String^ SavedItem1;
private: System::Void comboBox1_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e)
{
if(SavedItem1 != comboBox1->Text)
{
MessageBox::Show("Show Text");
SavedItem1 = comboBox1->Text;
}
}