c# - Map Property to User Control -
i have usercontrol
, have added property it. want property added properties window
whenever usercontrol
added form.
this used add property
image img; public image setimage { { return img; } set { img = value; } }
this works fine problem whenever user wants call property, user have call class of user control like
mycontrol ctrl = new mycontrol(); ctrl.image = image.fromfile("/*path image*/");
but change property controls have been added form need map usercontrol whenever user want call it, user call like
mycontrol1.image = image.fromfile("/*path image*/");
or
mycontrol2.image = image.fromfile("/*path image*/");
pls how acheive this?
add [browsable(true)]
tag (which in system.componentmodel
namespace inside system.dll
) desired property of user control class:
public class yourusercontrol { .... .... [browsable(true)] public image setimage { { return img; } set { img = value; } } }
Comments
Post a Comment