How to set the TypeConverter of a Control?
-
:confused: A custome control, which has a property "NormalImage", its type is Image. When I use this control, In the Property Editor, once I have assign the property NoarmalImage a Bitmap, I can't set it to null anymore. How can I set this property to be can-set-empty with attribute attached to this property? The native control Button of .net framework has a property "Image", and it can be set to empty(null) through press the key "delete". How can I do like this? Someone can answer me?
-
:confused: A custome control, which has a property "NormalImage", its type is Image. When I use this control, In the Property Editor, once I have assign the property NoarmalImage a Bitmap, I can't set it to null anymore. How can I set this property to be can-set-empty with attribute attached to this property? The native control Button of .net framework has a property "Image", and it can be set to empty(null) through press the key "delete". How can I do like this? Someone can answer me?
Dear, Sir //If no the following line, press the key "Delete" will no result. [DefaultValue(null)] //<====this line is important. public Image Image { get {return yourImage; } set {yourImage = value; } } I have a problem above this message. can you help me? (see author: god4k). ;):|:|:|:|:|:|:|;)
-
Dear, Sir //If no the following line, press the key "Delete" will no result. [DefaultValue(null)] //<====this line is important. public Image Image { get {return yourImage; } set {yourImage = value; } } I have a problem above this message. can you help me? (see author: god4k). ;):|:|:|:|:|:|:|;)
The DefaultValueAttribute( null ) is what the runtime checks to see if the value is set to the default value. You also need to set the yourImage to null in the ctor or where it is declared. Also you need a method called ResetImage that simply sets yourImage member to null. Thank You Bo Hunter
-
Dear, Sir //If no the following line, press the key "Delete" will no result. [DefaultValue(null)] //<====this line is important. public Image Image { get {return yourImage; } set {yourImage = value; } } I have a problem above this message. can you help me? (see author: god4k). ;):|:|:|:|:|:|:|;)