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. Adding control to a form delets the custom control from the form

Adding control to a form delets the custom control from the form

Scheduled Pinned Locked Moved C#
csharpvisual-studioxmlhelptutorial
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.
  • S Offline
    S Offline
    SandeepN
    wrote on last edited by
    #1

    I have combobox custom control developed by my collogues in C#. I reuse it often in my project. I have some problem when I reopen my project in V.S. Like if I make some changes, add some more standard control and save it. The visual studio envirnoment deletes this custom control from the form. It deletes all the entries of this CC from both .cs and .resx file. Any idea why this is happening ? And how to avoid it ? I have a work around for this when ever I have to add new control I manualy edit the CS file in notepad (Its pain, bcoz got use to VS no more programming in Windows SDK). But I don't modify the .resx (because its complecated XML). Does this ( not modifying .resx file ) cause any problem ? Sandeep Naik

    J 2 Replies Last reply
    0
    • S SandeepN

      I have combobox custom control developed by my collogues in C#. I reuse it often in my project. I have some problem when I reopen my project in V.S. Like if I make some changes, add some more standard control and save it. The visual studio envirnoment deletes this custom control from the form. It deletes all the entries of this CC from both .cs and .resx file. Any idea why this is happening ? And how to avoid it ? I have a work around for this when ever I have to add new control I manualy edit the CS file in notepad (Its pain, bcoz got use to VS no more programming in Windows SDK). But I don't modify the .resx (because its complecated XML). Does this ( not modifying .resx file ) cause any problem ? Sandeep Naik

      J Offline
      J Offline
      Jay Shankar
      wrote on last edited by
      #2

      Does your friend's comboBox custom control constructor requires some argument? If yes. That is causing the problem. Actually only default constructors are supported by .Net Designer. Making designer to support the overloaded constructors with arguments, requires some additional things to do. I am not very clear about this. Some body else may give you more detail informations. Regards, Jay

      1 Reply Last reply
      0
      • S SandeepN

        I have combobox custom control developed by my collogues in C#. I reuse it often in my project. I have some problem when I reopen my project in V.S. Like if I make some changes, add some more standard control and save it. The visual studio envirnoment deletes this custom control from the form. It deletes all the entries of this CC from both .cs and .resx file. Any idea why this is happening ? And how to avoid it ? I have a work around for this when ever I have to add new control I manualy edit the CS file in notepad (Its pain, bcoz got use to VS no more programming in Windows SDK). But I don't modify the .resx (because its complecated XML). Does this ( not modifying .resx file ) cause any problem ? Sandeep Naik

        J Offline
        J Offline
        Jay Shankar
        wrote on last edited by
        #3

        I just found the details. There is reply from Mr. Heath detailing the same subject. Below is the link: Custom Controls and GUI Designer[^]

        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