how do you get the picture browser dialog as design-time property?

P

PeterB

If you add a picturebox to your form in VS.NET, it comes with an Image
property. Clicking the button in this property opens a file dialog where you
can select you picture file.

How would you do this for your own custom control?

I've searched MSDN and found these articles (among others):
http://msdn.microsoft.com/library/d...ide/html/cpconenhancingdesign-timesupport.asp
http://msdn.microsoft.com/library/d...de/html/cpconattributesdesign-timesupport.asp

but none of them seem to answer this question...

thanks in advance,

Peter
 
G

Guest

I don't think that there's something special needed for that. Just make sure
that your property is declared as Image type. SOmething like that:

#if DESIGN
[
Category("Appearance"),
Description("The Image object"),
DefaultValue(null),
Browsable(true)
]
#endif
public Image Image
{
get
{
return this._bitmap;
}
set
{
this._bitmap = value;
this.Invalidate();
}
}

HTH... Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top