控件得到焦点后会自动失去.
comboBox = new ComboBox();
foreach(IComponent cmp in Context.Container.Components )
{
comboBox.Items.Add(cmp.Site.Name);
}
Rectangle rect = columnList.SelectedItems[0].Bounds;
rect.X = rect.X + columnList.Columns[0].Width;
rect.Y = rect.Y -5;
rect.Height = rect.Height + 5;
rect.Width = columnList.Columns[1].Width + columnList.Columns[2].Width;
comboBox.Text = m_data[tableList.Text][m_preSelected].CombinationString;
comboBox.Bounds = rect;
comboBox.MouseHover +=new EventHandler(comboBox_MouseHover);
comboBox.Parent = columnList;
comboBox.LostFocus +=new EventHandler(comboBox_LostFocus);
comboBox.SelectedValueChanged +=new EventHandler(comboBox_SelectedValueChanged);
comboBox.Show();
comboBox.Focus();
这段代码执行完自动调用comboBox_LostFocus的代码.但在有的机器上却不会,很奇怪.请问是什么原因.