Inheritance
-
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.
-
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.
-
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.
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
-
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.
-
Changing the modifiers of the inner controls from a default 'private' to 'public' may serve ur purpose. Regards, KKrista
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
-
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.
it's not possible u can do that through coding.. but it's not possible at design (atleast according to my knowledge)
-
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.
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;