Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclassing Common Controls
Message
De
02/11/2009 18:04:12
 
 
À
02/11/2009 13:00:10
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Divers
Thread ID:
01432616
Message ID:
01432809
Vues:
39
Hi Bonnie

Sorry, I did not notice that.

But even then wouldn't subclassing the base classes hold for WPF as well as Windows Forms?

Anyway I would appreciate an answer to my question with regard to Winforms, not WPF in this instance.

I mean about subclassing a group of controls in a panel as described below.
Here is another link to an image

http://www.foxite.com/uploads/9435e32d-633b-4007-8084-c8be972e0d36.jpg

Also the Q I posted on your blog, how do I now change the icon of the subclassed controls in the toolbox?

Thanks


>Hi Bernard,
>
>First, thanks for reading my blog!
>
>Second, I just wanted to make sure I fully understood what you're asking about. My blog post is about WinForms sub-classes. You posted your question under the WPF category ... so, I'm wondering if you're talking about sub-classing WinForm controls or WPF controls? If WPF, you should not even bother with my blog post because I have no idea how/if any of that applies to WPF (I'm still a noob at that).
>
>~~Bonnie
>
>
>>Hi
>>
>>I read this post on Bonnie's site:
>>
>>http://geek-goddess-bonnie.blogspot.com/2009/10/why-and-how-to-sub-class-base-classes.html
>>
>>Since I have done this in VFP with all the base classes, I thought it made sense to do it in .NET. as well.
>>
>>However the biggest drag I found was that these controls cannot be Visually subclassed. You have to set everything in code, even the colours etc. so you don't really know how they will look till you use them.
>>However for single controls this is not such a problem as I just had a form also open and designed in that and then copied the code/properties across.
>>
>>The problem was when I wanted to subclass a group of controls. The code quickly became very verbose ...
>>
>>For instance I have a Panel that contains info on a persons Credit Card - so in the panel will be a Couple of textboxes , one of which is masked with X's, a combo, a datepicker and a couple of checkboxes using the base objects I had just subclassed above. Also some labels for each "field".
>>
>>A control like that I use in a number of forms so it made sense to create a class of it to reuse.
>>
>>Looks like this:
>>http://weblogs.foxite.com/photos/bernardbout/picture9263.aspx
>>
>>But I can find no way of doing this now that I have a design on a form. So I am looking for some help on how to create this control, with code behind it so that I can just drop it and reuse it in a form.
>>
>>Basically I want to know how I can create a class of this and add it to my classes so that I can then add it to the toolbox and use it like the above individual controls.
>>
>>The code VS generates is extremely verbose so I won't post it here.
>>
>>Will Visual Studio ever fulfil its name and allow a class to be designed visually?
>>
>>Bernard
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform