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. Inheritance

Inheritance

Scheduled Pinned Locked Moved C#
ooptutorialquestion
7 Posts 6 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.
  • Z Offline
    Z Offline
    zwan13
    wrote on last edited by
    #1

    Hi, I'm developing a user control that is composed by other controls. I'd like to know if it's possible to acces this inner controls at desing time when I use them in my application. I mean, if my control has a Button, Can I access that button once I've put the control in my application Form? I Know I can access by code but I want to access in the designer. For example I wanto to change the location of the button. I think it isn't possible, I'm right? Thanks.

    G C K N G 5 Replies Last reply
    0
    • Z zwan13

      Hi, I'm developing a user control that is composed by other controls. I'd like to know if it's possible to acces this inner controls at desing time when I use them in my application. I mean, if my control has a Button, Can I access that button once I've put the control in my application Form? I Know I can access by code but I want to access in the designer. For example I wanto to change the location of the button. I think it isn't possible, I'm right? Thanks.

      G Offline
      G Offline
      gauthee
      wrote on last edited by
      #2

      You can position your controls in the designer! however the positioning property should be set accordingly!

      Gautham

      1 Reply Last reply
      0
      • Z zwan13

        Hi, I'm developing a user control that is composed by other controls. I'd like to know if it's possible to acces this inner controls at desing time when I use them in my application. I mean, if my control has a Button, Can I access that button once I've put the control in my application Form? I Know I can access by code but I want to access in the designer. For example I wanto to change the location of the button. I think it isn't possible, I'm right? Thanks.

        C Offline
        C Offline
        Colin Angus Mackay
        wrote on last edited by
        #3

        You can position the controls of a user control in the designer for the user control. If you then put the user control on a form you can only positition the whole user control as one, and not any idividual buttons that happen to be on it.


        Upcoming events: * Glasgow: SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services... * Reading: Developer Day 5 Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

        1 Reply Last reply
        0
        • Z zwan13

          Hi, I'm developing a user control that is composed by other controls. I'd like to know if it's possible to acces this inner controls at desing time when I use them in my application. I mean, if my control has a Button, Can I access that button once I've put the control in my application Form? I Know I can access by code but I want to access in the designer. For example I wanto to change the location of the button. I think it isn't possible, I'm right? Thanks.

          K Offline
          K Offline
          KKrista
          wrote on last edited by
          #4

          Changing the modifiers of the inner controls from a default 'private' to 'public' may serve ur purpose. Regards, KKrista

          C 1 Reply Last reply
          0
          • K KKrista

            Changing the modifiers of the inner controls from a default 'private' to 'public' may serve ur purpose. Regards, KKrista

            C Offline
            C Offline
            Colin Angus Mackay
            wrote on last edited by
            #5

            That would be unwise. It would break encapsualation. The better approach would be to have a set of methods that control access to just the things you want something outside to be able to manipulate.


            Upcoming events: * Glasgow: SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services... * Reading: Developer Day 5 Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

            1 Reply Last reply
            0
            • Z zwan13

              Hi, I'm developing a user control that is composed by other controls. I'd like to know if it's possible to acces this inner controls at desing time when I use them in my application. I mean, if my control has a Button, Can I access that button once I've put the control in my application Form? I Know I can access by code but I want to access in the designer. For example I wanto to change the location of the button. I think it isn't possible, I'm right? Thanks.

              N Offline
              N Offline
              Nouman Bhatti
              wrote on last edited by
              #6

              it's not possible u can do that through coding.. but it's not possible at design (atleast according to my knowledge)

              1 Reply Last reply
              0
              • Z zwan13

                Hi, I'm developing a user control that is composed by other controls. I'd like to know if it's possible to acces this inner controls at desing time when I use them in my application. I mean, if my control has a Button, Can I access that button once I've put the control in my application Form? I Know I can access by code but I want to access in the designer. For example I wanto to change the location of the button. I think it isn't possible, I'm right? Thanks.

                G Offline
                G Offline
                Guffa
                wrote on last edited by
                #7

                Strange subject; this has nothing to do with inheritance. You don't inherit a class when you create an instance of it. It might be possible to build something that might enable you to redesign elements in the control in the designer, by exposing the location of the control as a property, and write code to handle the changes at design time. If it's even possible, it's probably far more work that it's worth. I would suggest that you create a property in the user control that decides the location of the button. Like a ButtonLocation property that takes an enum value that represents the location.

                --- single minded; short sighted; long gone;

                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