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. Problem inheriting form

Problem inheriting form

Scheduled Pinned Locked Moved C#
oophelptutorialquestion
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.
  • E Offline
    E Offline
    EnkelIk
    wrote on last edited by
    #1

    Hello all. I'm having a problem letting one form inherit another. I have a simple wizard implementing the base functionality and then I have a couple of wizards that inherit from the base wizard, where I add the necessary textboxes, comboboxes and so on. I saw it called "Visual inheritance" at one place... At first it worked relatively well but now it is all a mess. My problem is this: if I add for example a textbox to an inherited form in the designer and I change a couple of properties on the textbox (AllowReturn set MultiLine to true, set some default text e.t.c.), I save the form (usually goes well) and then I compile and suddenly the textbox looses all the properties I have set -except for the ID, and moves up to the upper left corner of the form!?! Or I don't compile but I add an eventhandler for some other control, goes into the code and then returns to the designer and KABOOM! The textbox is in the upper left corner without the properties I gave it! What have I missed? I had minor problems before, that the controls occasionally lost the properties overriding the basewizard properties, but not like this. I don't know if it is related but it seems that since I moved to WinXP servicepack 2 about a week ago, it has stopped working alltogether. Any ideas? Getting a bit desperate as my project is due soon! Thanks /EnkelIk

    S 1 Reply Last reply
    0
    • E EnkelIk

      Hello all. I'm having a problem letting one form inherit another. I have a simple wizard implementing the base functionality and then I have a couple of wizards that inherit from the base wizard, where I add the necessary textboxes, comboboxes and so on. I saw it called "Visual inheritance" at one place... At first it worked relatively well but now it is all a mess. My problem is this: if I add for example a textbox to an inherited form in the designer and I change a couple of properties on the textbox (AllowReturn set MultiLine to true, set some default text e.t.c.), I save the form (usually goes well) and then I compile and suddenly the textbox looses all the properties I have set -except for the ID, and moves up to the upper left corner of the form!?! Or I don't compile but I add an eventhandler for some other control, goes into the code and then returns to the designer and KABOOM! The textbox is in the upper left corner without the properties I gave it! What have I missed? I had minor problems before, that the controls occasionally lost the properties overriding the basewizard properties, but not like this. I don't know if it is related but it seems that since I moved to WinXP servicepack 2 about a week ago, it has stopped working alltogether. Any ideas? Getting a bit desperate as my project is due soon! Thanks /EnkelIk

      S Offline
      S Offline
      sreejith ss nair
      wrote on last edited by
      #2

      hi, This may not the reason but still you can check the Modifiers property of the object's that you are trying to access. Change it to public. Cause you are changing the values after inheriting the object. Change the property Modifiers and set value true.:) ************************** S r e e j i t h N a i r **************************

      E 1 Reply Last reply
      0
      • S sreejith ss nair

        hi, This may not the reason but still you can check the Modifiers property of the object's that you are trying to access. Change it to public. Cause you are changing the values after inheriting the object. Change the property Modifiers and set value true.:) ************************** S r e e j i t h N a i r **************************

        E Offline
        E Offline
        EnkelIk
        wrote on last edited by
        #3

        Thanks! That may very well be a solution to some of my problems; I'll try that. I restarted my computer and that helped on the most frustrating thing (the textbox now keeps it's size even after saving and compiling the project), so maybe I just really need to reinstall my computer, but hopefully your tip can solve the other properties being lost (which I have had since I started with the inherited forms). Thanks /EnkelIk

        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