Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Custom Controls

Custom Controls

Scheduled Pinned Locked Moved C#
questionhelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tyrus182
    wrote on last edited by
    #1

    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,

    M 1 Reply Last reply
    0
    • T Tyrus182

      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,

      M Offline
      M Offline
      Martin 0
      wrote on last edited by
      #2

      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

      T 1 Reply Last reply
      0
      • M Martin 0

        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

        T Offline
        T Offline
        Tyrus182
        wrote on last edited by
        #3

        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.

        M 1 Reply Last reply
        0
        • T Tyrus182

          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.

          M Offline
          M Offline
          Martin 0
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups