Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Just starting in .NET
Message
De
15/03/2009 23:55:31
 
 
À
15/03/2009 22:52:55
Lynda Loveland
Minneapolis, Minnesota, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01388286
Message ID:
01388289
Vues:
165
Hi Lynda,

You should get some good info here. I'll give you a good tip right off the bat. You know how in VFP you should always sub-class everything and use the sub-classes in your apps? Same goes for .NET. In fact, the first thing I'd do if I were you, would be to start by sub-classing all the UI controls (you know, TextBox, ComboBox, etc.) ... even if you don't have any code in them at first.

And just to get you started (and I'm making an assumption here, that you're interested in WinForms and not WebForms):

Basically, you'll want a class library that contains your sub-classed UI controls, like textbox, button, etc. 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 : System.Windows.Forms.ComboBox
	{
		// code here
	}

	public class MyTextBox : System.Windows.Forms.TextBox
	{
		// code here
	}

	public class MyButton : System.Windows.Forms.Button
	{
		// code here
	}
}
That's it. These controls can't be sub-classed visually, but as you can see, it's easy enough to do it in code. I have all the basic controls sub-classed in one class library file. Once they're added to the ToolBox, then can be dragged onto any design surface in the IDE.

Welcome to the UT! =0)

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform