Results 1 to 3 of 3

Thread: Property of Image type for Custom Controls

  1. #1

    Thread Starter
    New Member blue_rabbit's Avatar
    Join Date
    May 2004
    Location
    Behind enemy lines
    Posts
    9

    Question Property of Image type for Custom Controls

    I'm creating a custom control that has two properties of type System.Drawing.Image, among others.

    My question is, when I try to set the property to (none) by deleting the 'filename' from the property field, like you can with, say a PictureBox.Image property, i'm unable to do so.

    What am i missing here?
    //END_TRANSMISSION

  2. #2
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    Hi.

    You need to apply the DefaultValue attribute to your property.
    That way you can right-click it in the propertygrid and select reset.

    VB Code:
    1. <DefaultValue(GetType(Image), Nothing)> Public Property MyImage1.....
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

  3. #3

    Thread Starter
    New Member blue_rabbit's Avatar
    Join Date
    May 2004
    Location
    Behind enemy lines
    Posts
    9
    Mille Grazie!
    //END_TRANSMISSION

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width