I need help in creating a shopping list in Windows Forms Application C++ in Visual Studio 2015. I have learned the basics about C++, but they dont seem to help me here when I am trying to create an windows app.
This i how a part of the MyForm.h-file look for my Windows Forms application:
It doesnt seem to work, meaning the funktion abow doesnt work. I want to specificaly delete a text in my shoppinglist(texBox2). So how do you do that???
Ok if I where you use a ListBox then how do I then input different groseries into the listbox and then how do I specificaly delete chosen groseries from the listbox?
What are the codes for them?:
If this is how my codes look in MyForm.h : Button3 is to remove text from listbox1, And button2 is to add text into listbox.
// add item to listbox
listBox1->Items->Add(textBox1->Text);
textBox1->Clear();
textBox1->Focus();
Removing item form listbox:
1 2 3 4 5 6 7
// find index of text
int index = listBox1->Items->IndexOf(textBox1->Text);
if (index != -1) // found
listBox1->Items->RemoveAt(index);
else
MessageBox::Show("Item not found");