I wanted to add a DoubleClick handler to an item in a ListBox (assume it is called ListBox
), but I could not get it to appear using the Designer view.
I.E., double-clicking on the ListBox, I would only ever get ListBox_SelectedIndexChanged
handlers wired up for me. (My list-box items are programmatically assigned, so there were no items in the Design view to click on -- is that an issue?)
I did work around this by coding up the handler myself (based on C# Listbox Item Double Click Event) but that took further research, since I had no idea that instead of looking for a MouseEventHandler
in System, I had to drill down to System.Windows.Forms.
. How annoying.
I.E., this.ListBox.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.ListBox_MouseDoubleClick);
So, is it possible to auto-generate a MouseDoubleClick event in the Design view?
Or do they have to be wired up by hand?
Not that I'm lazy, or anything. Other than using Visual Studio, I mean......