I'm running into a strange problem (or at least it seems strange to me). I
have a standard list box (System.Windows.Form.ListBox) on a form and I'm
trying to trap for activity on the SelectedIndexChanged event. It works fine
if you change the selected item via the keyboard (arrow keys), but if you
click on a different item, the SelectedIndexChanged event is not getting
fired.

Has anyone else experienced this weird behavior? If so, is there a solution?
Or am I just looking in the wrong place and should be concentrating on a
different event?

Thanks!

evan stone | software engineer
----------------------------------------
santa rosa, ca, usa

Re: SelectedIndexChanged not firing on mouse click by Dmytro

Dmytro
Fri Oct 14 05:34:22 CDT 2005

Hi Evan,

Could it be something similar to the situation described in the following
message thread (mind the line wraps)?

http://groups.google.com/group/microsoft.public.dotnet.framework.windowsforms/browse_frm/thread/cb1a4e70fea8e028/b6c33f129e224c79?lnk=st&q=SelectedIndexChanged+mouse+click+listbox+group:microsoft.public.dotnet.*&rnum=3&hl=en#b6c33f129e224c79

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]


"Evan Stone" <recombinantspam_n0spaam@hotmail.com> wrote in message
news:%23bQrlQE0FHA.2132@TK2MSFTNGP15.phx.gbl...
> I'm running into a strange problem (or at least it seems strange to me). I
> have a standard list box (System.Windows.Form.ListBox) on a form and I'm
> trying to trap for activity on the SelectedIndexChanged event. It works
> fine
> if you change the selected item via the keyboard (arrow keys), but if you
> click on a different item, the SelectedIndexChanged event is not getting
> fired.
>
> Has anyone else experienced this weird behavior? If so, is there a
> solution?
> Or am I just looking in the wrong place and should be concentrating on a
> different event?
>
> Thanks!
>
> evan stone | software engineer
> ----------------------------------------
> santa rosa, ca, usa
>
>


Re: SelectedIndexChanged not firing on mouse click by Evan

Evan
Fri Oct 14 12:55:11 CDT 2005

I believe so, yes. As it turns out, I _am_ doing a DoDragDrop call in the
MouseDown event, so that must be the problem.

Unfortunately, there's no real solution contained in that thread, and the
Syncfusion article referenced is a dead link.

If anyone has any further suggestions or information I'd appreciate it...
Or, I may just not worry about doing anything on the SelectedIndexChanged
event after all, if there's no easy(ish) solution.

Thanks!

evan stone | software engineer
----------------------------------------
santa rosa, ca, usa


"Dmytro Lapshyn [MVP]" <x-code@no-spam-please.hotpop.com> wrote in message
news:OPHFerK0FHA.3812@TK2MSFTNGP09.phx.gbl...
> Hi Evan,
>
> Could it be something similar to the situation described in the following
> message thread (mind the line wraps)?
>
>
http://groups.google.com/group/microsoft.public.dotnet.framework.windowsforms/browse_frm/thread/cb1a4e70fea8e028/b6c33f129e224c79?lnk=st&q=SelectedIndexChanged+mouse+click+listbox+group:microsoft.public.dotnet.*&rnum=3&hl=en#b6c33f129e224c79
>
> --
> Sincerely,
> Dmytro Lapshyn [Visual Developer - Visual C# MVP]



Re: SelectedIndexChanged not firing on mouse click by Evan

Evan
Fri Oct 14 13:15:22 CDT 2005

> Unfortunately, there's no real solution contained in that thread, and the
> Syncfusion article referenced is a dead link.

The article was not deleted, it was just moved:

http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c87c.aspx#q610q

:)

evan stone | software engineer
----------------------------------------
santa rosa, ca, usa