Bitmap[] property

  • Thread starter Thread starter dany
  • Start date Start date
D

dany

If I set property in my user control like this

/////////////////////////////////////
private Bitmap im;

public Bitmap IM
{
get
{
return im;
}
set
{
im= value;
}
}
/////////////////////////////////////

everything works fine, but if I set it like this:

/////////////////////////////////////
private Bitmap[] im;

public Bitmap[] IM
{
get
{
return im;
}
set
{
im= value;
}
}
/////////////////////////////////////

I'm getting error when i try to add new bitmap to collection trough property
window:
Parameter is not valid.

can someone help, I dont want to limit number of bitmaps to user and I dont
want to initialize them on control start.

Thank you.
 
 If I set property in my user control like this

/////////////////////////////////////
 private Bitmap im;

 public Bitmap IM
{
    get
    {
        return im;
    }
    set
    {
        im= value;
    }}

/////////////////////////////////////

everything works fine, but if I set it like this:

/////////////////////////////////////
 private Bitmap[] im;

 public Bitmap[] IM
{
    get
    {
        return im;
    }
    set
    {
        im= value;
    }}

/////////////////////////////////////

I'm getting error when i try to add new bitmap to collection trough property
window:
Parameter is not valid.

can someone help, I dont want to limit number of bitmaps to user and I dont
want to initialize them on control start.

Thank you.

Hi,

Can you give more details, what are you trying to do, what error are
you getting, etc
IIRC for a designable control you need to use ImageList, at least that
is what all other controls in the framework use
 
message

Hi,

Can you give more details, what are you trying to do, what error are
you getting, etc
IIRC for a designable control you need to use ImageList, at least that
is what all other controls in the framework use
 

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

Back
Top