Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclass
Message
 
To
26/04/2008 10:22:34
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Environment versions
Environment:
C# 3.0
OS:
Vista
Miscellaneous
Thread ID:
01313200
Message ID:
01313283
Views:
7
Bonnie,

I'm not sure that's the right answer, although I don't know for sure myself. Maybe Kevin will answer us better.

I know that when you use MM and create a form you create it from an MM template which is an MM class. I think the real question is is how to subclass the MM classes.

>>How do I subclass a MM form or MM control?
>
>The same way you would sub-class the base .NET controls. I typically have a project that's included in all my apps that contains most of these sub-classes. Things like Forms can be sub-classed visually ... add a Form to your project (right-click, add new Item, choose a Form), then simply go to the code and change:
>
>
>public partial class MyForm : System.Windows.Forms.Form
>
>to
>
>public partial class MyForm : MMForm
>
>(I don't use MM, so I don't know what the proper name of the form is).
>
>Other things, like TextBoxes, Buttons, etc., can't be sub-classed visually. So basically, you'll want one big class library (one file) that contains your sub-classed UI controls. Something like this:
>
>using System;
>using System.Drawing;
>using System.Collections;
>using System.ComponentModel;
>using System.Windows.Forms;
>using System.Data;
>
>namespace MyCompany.MyFramework.WinUI.MyClasses
>{
>	public class MyComboBox : MMComboBox
>	{
>		// code here
>	}
>
>	public class MyTextBox : MMTextBox
>	{
>		// code here
>	}
>
>	public class MyButton : MMButton
>	{
>		// code here
>	}
>}
>
>That's it.
>
>~~Bonnie
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform