I have a listbox called "lstProducts". When a specific product is "clicked", a description of that specific product is supposed to show up in the textbox "txtDescription" next to the listbox in the GUI. My question is how
can I can include a specific description in a textbox called "txtProductDetails" when I click on a specific product in the listbox called "lstProducts"? Should I just use a command button called "Description" and include the switch
statement? I am supposed to use loops for my assignment since they are easier than a long IF statement. Here is my code so far:
private void btnDescription_Click(object sender, EventArgs e)
{
string product;
if (lstProducts.SelectedIndex != -1)
{
product = lstProducts.SelectedItem.ToString();
switch (product)
{
case "Microsoft Surface":
txtProductDetails.Text = "Screen Size: 10.6'' Storage Capacity: 128 GB";
break;