January 13th, 2013, 01:13 PM
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.
January 17th, 2013, 12:13 AM
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,
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.
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!