A bit of background: I am a WPF converter for WinForms, and for a while I am porting my application.
A friend told me that my code does not work on Windows XP (it generates a stack overflow on startup), although it works fine on Windows 7 (which I am developing).
After a little research on what caused the problem, there was something like that:
private void listView1_SelectedIndexChanged(object sender, EventArgs e) { listView1.SelectedIndices.Clear(); listView1.Items[0].Selected = true; }
Now that I noticed a clearly bad solution, I did not wonder why it does not work in Windows XP. I was wondering why this works on Windows 7.
Obviously, at some point, the compiler finds out what I'm trying to do and prevents the same event from firing again, but I would prefer it to not do anything, so I see a squish error on the platform view that I I'm developing, instead of testing it on two platforms at the same time. In WPF, I could handle this behavior manually by setting e.Handled to “true”, apparently there is no such thing in WinForms.
Is there any compiler flag for this?
Kuraj
source share