c# - Associate some value with Image that represents that value -


is possible image associated value?

i'm trying have button press click , random image comes up. image represent value either 10, 20, or close program.

how can assign image shows randomly have set value , increment go until close image show?

do mean image control? can use tag property store second value (in addition imagesource image property).

var random = new random(); var x = random.next(0, 3)]; myimage.source = myimagessources[x] myimage.tag = x;//or want 

you can derivate class imagesource , pass value instance.

public class test : imagesource {     public int value{get;set;}     //implementing necessary code imagesource 

or use list<tuple<t1,t2>> or dictionary<tkey,tvalue> store images there values.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -