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
What are the different cloud platforms?
Name the class to be inherited for creating a custom control.
What is window form application?
how barcode print on the win form
Name the property which of menu cannot be set at run time?
What is a windows based application?
Is windows an application software?
Which command prompt utility is used to convert a resource file from the text format into the binary format?
Which of the following position is the default docking position of the statusstrip control on the form?
Explain how to find the current record position in data control?
Name the property which is used to lock a textbox to enter data?
What is a windows forms application?
How to show a ContextMenuStrip instead of cthe default ContextMenuStrip,when you rightclick on the non client area of a window's Form or when alt+space keys are pressed
Which dialog box allows users to switch to another area of the application?
Explain how barcode create in the report?