I have two combobox .. and i have some items in both combobox
now i need to check the item in both combobox if same item
is Present in both combobox i need to display that item in
message box

Answer Posted / pavel

bool found = false;
string item = string.Empty;
foreach (string item1 in comboBox1.Items)
{
foreach (string item2 in comboBox2.Items)
if (item1 == item2)
{
item = item1;
found = true;
break;
}
if (found) break;
}
MessageBox.Show(found ? item : "Not found");

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

which property is used to change to some value to access a identity column in datacontrols?

1908


What is the extension of the windows installer file?

838


Name the two main categories of .net components.

764


Explain the difference between listindex and tab index?

778


What is formdata?

787


What are the different cloud platforms?

768


Which property of the progressbar control specifies the amount to increment the current value of the control?

782


How to create a set up in vb.net for desktop application please say steps with examples?

759


Which command prompt utility is used to convert a resource file from the text format into the binary format?

860


how print barcode

2337


What is form design?

767


Explain the difference between listbox and combo box?

747


How insert record in the database?

817


Name the method that has to be overridden to change the appearance of the control that is inherited from an existing control.

788


What are the components of gui for windows?

742