Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie class creation question
Message
De
21/07/2004 09:58:59
John Baird
Coatesville, Pennsylvanie, États-Unis
 
 
À
21/07/2004 09:45:50
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00926521
Message ID:
00926534
Vues:
16
Hi Mike,

This is the reason so many VFP'ers are reluctant to move to .net. We (VFP'ers) are terribly spoiled by one of the best RAD environments on the market, alas, that doesn't carry over to .net. :(.

I was disappointed to find out that there is no base mover class in .net. You have to engineer your own. The codeproject and syncfusion have been a godsend in helping me learn (as well as BB, and Kevin Goff :)) Just hang in there, it'll come.



>Hi John,
>
>Thanks for the reply. You confirmed my suspicions. I know we're programmers and cutting code is what we do, but, doesn't it seem like a step backwards to have to write code to do this basic stuff <g>?
>
>I mean, if I want to set the background color of my button class to "SomeNiceShadeOfBlue" and I don't know what that looks like, how do I know what value I should use? In Fox we just used the color picker (and Font too if required) and instantly see the results. Have I been spoiled when it comes to this stuff?
>
>
>Mike
>
>
>
>>Hi MIke... you can't design your base control classes visually in .net. You must do it programmatically. Once you have done this, you can add them to the toobox and drag them onto forms, controls, etc.
>>
>>Here is a sample of mine ( I have removed a lot of it for space sake).
>>
>>
>>
>>using System ;
>>using System.Drawing;
>>using System.Windows.Forms;
>>using System.ComponentModel;
>>using System.Collections;
>>using System.Diagnostics;
>>using System.Data;
>>
>>namespace Quay.Base
>>{
>>	/// <summary>
>>	/// Summary description for Class1.
>>	/// </summary>
>>	public class frmBase : System.Windows.Forms.Form
>>	{
>>		#region Properties
>>		private bool _IsLoggedIn = false;
>>		private string _ServerName = "";
>>		private string _ServerCatalog = "";
>>		private char _Mode = ' ';
>>
>>		public char Mode	
>>		{
>>			get	{return _Mode;}
>>			set	{_Mode = value;}
>>		}
>>
>>		public bool IsLoggedIn	
>>		{
>>			get	{return _IsLoggedIn;}
>>			set	{_IsLoggedIn = value;}
>>		}
>>
>>		public string ServerName	
>>		{
>>			get	{return _ServerName;}
>>			set	{_ServerName = value;}
>>		}
>>	
>>		public string ServerCatalog	
>>		{
>>			get	{return _ServerCatalog;}
>>			set	{_ServerCatalog = value;}
>>		}
>>		#endregion
>>
>>		public frmBase()
>>		{
>>			this.Font = new Font("Arial", 8);
>>		}
>>	}
>>
>>	public class cboBase : System.Windows.Forms.ComboBox
>>	{
>>		public cboBase()
>>		{
>>			this.Font = new Font("Arial", 8);
>>		}	
>>	}
>>
>>	public class chkBase : System.Windows.Forms.CheckBox
>>	{
>>		public chkBase()
>>		{
>>			this.Font = new Font("Arial", 8);
>>		}
>>	}
>>
>>	public class lblBase : System.Windows.Forms.Label
>>	{
>>		public lblBase()
>>		{
>>			this.Font = new Font("Arial", 8);
>>			this.TextAlign = ContentAlignment.MiddleRight;
>>
>>			//this.BackColor = Color.White;
>>		}
>>	}	
>>}
>>
>>
>>
>>
>>>Hi,
>>>
>>>I have a VFP background and I'm dipping my toes into the C# world and have immediately stumbled :)
>>>
>>>I am accustomed to designing my base classes visually. For example, I subclass a native VFP button by dropping one on a form in the form designer, set the button's properties for Font, ForeColor, BackColor, Flat, etc. then save the button as a class. The button class is now available for drag and drop to other form. Simple and easy for me.
>>>
>>>How do I go about doing this (or somthing like it) in the C# .NET IDE? I can't seem to find a way to do the class design visually.
>>>
>>>
>>>TIA
>>>
>>>
>>>Mike
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform