If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hybrid View

Dictionary and listbox help, pls

ok, so i have a dictionary which stores <string,object> (a few values are given to the object, like path, title etc)and then i store them by strings in a listbox. My question is how do i search a dictionary(by clicking on a listbox) by its string and then find that object and lets say display its property title in a label.

Re: Dictionary and listbox help, pls

Suppose you have a dictionary named dict, then dict.ContainsKey("some key") will check for the existence of that key in the dictionary, dict["some key"] will retrieve the associated value (the object, in your case), and dict.TryGetValue(...) will combine these operations,

Best Regards,

BioPhysEngrhttp://blog.biophysengr.net
--
All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.