SelectionChangeCommited event on Combobox not triggered

There seems to be a problem with the .Net Combobox control ! Microsoft is stating it isn’t actually a real problem, but still it is something a programmer should know and if needed take care of.

Let me first explain the problem… If you use the mouse to open a combobox, but then use the arrow keys to navigate in the list and change focus with the tab key, the combobox will select the highlighted value, but will NOT trigger the SelectionChangeCommited event !!
So in other words, even though the programmes subscribes to this event to know when a user has selected a value, the program will not notice it.

According to this post : http://weblogs.asp.net/grobinson/archive/2005/09/21/425711.aspx, Microsoft is aware of this and regards it as standard behaviour. So we are left with the only option to write a workaround ourselves.

I’ve found a good starting solution here : https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3409311&SiteID=1, but I think this can be improved ! Because with this given solution, if a user still would use the mouse to select an item we would get the SelectionChangeCommited event twice.
So the workaround is to suppress the base event and only trigger our own. Here is the code…

[tags]SelectionChangeCommitted, combobox, c#[/tags]

Eye candy – Matteo Scalera

Another great artist Matteo Scalera !
His style looks a bit like Humberto Ramos to me and that is a good thing 🙂 !!

He comes from Italy and his blog is written in Italian, that makes it hard to read ;), but for more convenience he also has a DeviantArt site with most of his drawings, take a look here

[Tags]Matteo Scalera[/Tags]

Eye candy – Christian Nauck

It has been a while since my last Eye candy post 🙂 But today I’ve found a new one !!

Let me introduce to you Christian Nauck ! He’s a comic artist from Germany ( actually not only comic art 😉 ) that I just discovered through the great art display site DeviantArt.

I don’t know Christian Nauck through any of his comics, but what I’ve seen on DeviantArt makes me feel sorry I haven’t seen any work so far. ( But that is all my own fault 😉 )

Just take a look at his gallery here.

[Tags]Christian Nauck[/Tags]