I need to call a method every time the
user note.. key word "USER" changes the text of a comboBox. However, if I have a method that changes the text of my combobox(for some other unrelated purpose) it still goes to the EVENT. WHY, is this actually happening? And how do I fix this?
I created an event handler for my 2 comboboxes by placing the following in my 'form_load' Event().
cboClientList.TextChanged += new EventHandler(ComboListTextChanged);
cboHouseList.TextChanged += new EventHandler(ComboListTextChanged);
and in my event handler I check to see which combobox called the event like so,
void ComboIndexChanged(Object sender, EventArgs se)
{
if ((ComboBox)sender == cboClientList)
{
// code for the combobox1 text changed
{
if ((ComboBox)sender == cboHouseList)
{
// code for combobox2 text changed
}
}
This is all good for when a
user changes the text of the cboHouseList and cboHouseList objects (by clicking in the combo box and changing the text)
BUT again, if I have something like so in another method
the event still gets fired. How can I prevent this command from calling the event handler?
Please any help would be greatly appreciated!
NOTE: using .net 2.0
[Edited by - Instigator on August 20, 2008 6:20:27 PM]