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. Object of type 'A' cannot be converted to type 'A' with own Control.

Object of type 'A' cannot be converted to type 'A' with own Control.

Scheduled Pinned Locked Moved C#
helpphpdatabasecomquestion
3 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.
  • R Offline
    R Offline
    Roland Bar
    wrote on last edited by
    #1

    Hello, I have here and than the following Problem: I have a self-made control in a library that I use in my application. After a while the designer tells me, when I want to open the Form containing the Control, that he cannot convert type 'A' to type 'A', where 'A' is a own class that contains Data that can be changed with the control. In the InitializeComponent() of the Form there is the call this.theControl.TheA = ((A)(resources.GetObject("theControl.TheA"))); that I think causes the Problem. As with this the Data is serialized and deserialized, I believe that after changing the library that contains the control this serialize does not work in the same way (maybe the assembly version number is included?). Is there a way to take control over the storing of complex data to not have it serialized in the .resx file? Thanks for your help. Greets Roland


    Hi! I'm a signature virus. Copy me into your sig file and help me spread!

    Follow your Euro notes in their tracks

    J 1 Reply Last reply
    0
    • R Roland Bar

      Hello, I have here and than the following Problem: I have a self-made control in a library that I use in my application. After a while the designer tells me, when I want to open the Form containing the Control, that he cannot convert type 'A' to type 'A', where 'A' is a own class that contains Data that can be changed with the control. In the InitializeComponent() of the Form there is the call this.theControl.TheA = ((A)(resources.GetObject("theControl.TheA"))); that I think causes the Problem. As with this the Data is serialized and deserialized, I believe that after changing the library that contains the control this serialize does not work in the same way (maybe the assembly version number is included?). Is there a way to take control over the storing of complex data to not have it serialized in the .resx file? Thanks for your help. Greets Roland


      Hi! I'm a signature virus. Copy me into your sig file and help me spread!

      Follow your Euro notes in their tracks

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      You can change the way the designer serializes TheA property by putting the following attribute on TheA property: [DesignerSerializationVisibility(...)] Beyond that, if you want further control, you may need to have the control implement ISerializable and perform serialization that doesn't care about the version to get around this issue.

      R 1 Reply Last reply
      0
      • J Judah Gabriel Himango

        You can change the way the designer serializes TheA property by putting the following attribute on TheA property: [DesignerSerializationVisibility(...)] Beyond that, if you want further control, you may need to have the control implement ISerializable and perform serialization that doesn't care about the version to get around this issue.

        R Offline
        R Offline
        Roland Bar
        wrote on last edited by
        #3

        Thank you very much! Greets Roland


        Hi! I'm a signature virus. Copy me into your sig file and help me spread!

        Follow your Euro notes in their tracks

        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