Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating UI framework
Message
 
 
À
24/08/2009 04:29:55
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01420055
Message ID:
01420110
Vues:
37
>>I am just adding another question to my initial post (the topic/title is the same).
>>
>>I created a 'base' form with a couple of controls and then another form inherited from the "base" form. But when I try to move around the controls on the child form VS won't allow me. I can see that the controls have a little icon "locked". Is this how UI inheritance work in the WinForms? That is, you cannot change size and position of the controls on the child form?
>
>Correct. If you look in the .Designer.cs file for the parent class that defines the controls you will see they are private.
>If you change this to protected you can access the properties of the control in code in the derived class (but not in the designer).
>Snag with this is that if you make subsequent changes to the parent form in the designer it's Designer.cs code is over-written.
>Safer bet is to expose it as a property in the parent form. e.g:
protected Button MyButton
>        {
>            get { return button1; }
>            set { button1 = value; }
>        }
None of this gives you the ability to reposition controls of the parent class in the designer of a child class. Maybe you can use docking to give the result you want?
>HTH,
>Viv

Thank you very much for clarifying how the visual inheritance works in .NET. Not even close to VFP in terms of flexibility but I will have to learn to live with it.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform