L
Lei Gong
I have 2 forms, form1 contains a ListView. What I want to do is, when
clicking an item in the ListView, hide form1 and show form2. Code for
ListView's SelectedIndexChanged: { form2.Show(); this.Hide(); }. When I
click the item, form2 shows with form1's title and menu. I noticed that when
mouse down, the SelectedIndexChanged event was triggered and bring form2 to
front. But when mouse up, system redrawed the selected item and bring title
and menu back to form1's. I tried to handle MouseDown and MouseUp event of
ListView but they were never triggered. Now I used a tricky way to solve the
problem: start a thread and use Control.Invoke to switch forms. It is not
good, I think there must be a better solution. Thanks.
clicking an item in the ListView, hide form1 and show form2. Code for
ListView's SelectedIndexChanged: { form2.Show(); this.Hide(); }. When I
click the item, form2 shows with form1's title and menu. I noticed that when
mouse down, the SelectedIndexChanged event was triggered and bring form2 to
front. But when mouse up, system redrawed the selected item and bring title
and menu back to form1's. I tried to handle MouseDown and MouseUp event of
ListView but they were never triggered. Now I used a tricky way to solve the
problem: start a thread and use Control.Invoke to switch forms. It is not
good, I think there must be a better solution. Thanks.