Custom Controls
-
Hi i have a custom control and everything is working fine, except in my test project when i compile it the settings of the control revert back to the default settings, why are my settings not persisting, and how do i go about fixing this problem? Thank you,
-
Hi i have a custom control and everything is working fine, except in my test project when i compile it the settings of the control revert back to the default settings, why are my settings not persisting, and how do i go about fixing this problem? Thank you,
-
Hello Tyrus, Are you talking about property settings during design time? If yes, it's possible if you are using the "DefaultValue" attribute at your custom properties. Don't forget to init your class variables correct. All the best, Martin
well all my variables are initialized correctly to start with and then ill go in and change settings and stuff compile and then they dissapear and revert back to the original settings, and it doesn't happen every time i compile either it seems to be somewhat sporadic. i also am getting some wierd tasks telling me that there is object reference not set to an object or somehting like that.
-
well all my variables are initialized correctly to start with and then ill go in and change settings and stuff compile and then they dissapear and revert back to the original settings, and it doesn't happen every time i compile either it seems to be somewhat sporadic. i also am getting some wierd tasks telling me that there is object reference not set to an object or somehting like that.
It seems that you are using an object in your constructor, property or an eventhandler which is not "living" yet. So you get an null reference exception even at design time. Thats because the constructor of youre custom control is called when you compile your project. If you whant you can mail me the controls code or post it. All the best, Martin