-
January 13th, 2013, 01:13 PM
#1
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.
thanks
-
January 17th, 2013, 12:13 AM
#2
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,
BioPhysEngr
http://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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|