Bitmap[] property

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dany

    Bitmap[] property

    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.

  • Ignacio Machin ( .NET/ C# MVP )

    #2
    Re: Bitmap[] property

    On Apr 29, 10:22 am, "dany" <d...@dany.comw rote:
     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

    Comment

    • dany

      #3
      Re: Bitmap[] property


      "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin @gmail.comwrote in
      message
      news:83e64eb9-53e0-4aa6-8472-88720350505c@59 g2000hsb.google groups.com...
      On Apr 29, 10:22 am, "dany" <d...@dany.comw rote:

      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


      -----------------------------
      Hi,

      I would like to have array of bitmaps or images for my control, which user
      can set at desing time trough property window of my control.

      Comment

      Working...