我在Winforms中有这样的事件。 MouseOver
事件被触发一次,但下次鼠标移过控件时,事件不会被触发。
private void label7_MouseHover(object sender, EventArgs e)
{
foreach (var i in booklist)
{
{
SelectBookCombo.Items.Add(i.BookId);
}
}
ViewBookGrid.DataSource = booklist;
}
什么会导致事件只发射一次?
答案 0 :(得分:0)
ADD the code for also Booklist..
List<string> st = new List<string>();
public Form1()
{
InitializeComponent();
st.Add("JaySwaminarayan");
st.Add("Hari Pande");
}
private void label1_MouseHover(object sender, EventArgs e)
{
st.Add("How r You");
foreach (var i in st)
{
{
SelectBookCombo.Items.Add(i);
}
}
ViewBookGrid.DataSource = st;
}