Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to set values of two properties in other method
Message
De
18/02/2007 11:18:09
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
How to set values of two properties in other method
Divers
Thread ID:
01196933
Message ID:
01196933
Vues:
56
In C# .NET 2 winforms application I need to set table header forecolor and backcolor properties:
using System.Windows.Forms;
DataGridTableStyle tableStyle = new DataGridTableStyle();
Desktop td = new Desktop();
td.GetColors(tableStyle.HeaderForeColor,
    tableStyle.HeaderBackColor);

However colors are not changed since it seems that parameters are passed by value.
Which is the best practice for change colors ?
I'll prefer to execute only one query in sql server and not to add additional properties, classes and structures to code.

Desktop class GetColors method contains:
public void GetColors(System.Drawing.Color foreColor,
			System.Drawing.Color backColor) {

IDataReader tableReader = ExecReader(
   "SELECT hforecol,hbackcol FROM desktop");
if (tableReader.Read()) {
	foreColor = GetColor(tableReader.GetDecimal(0));
	backColor = GetColor(tableReader.GetDecimal(1));
	}
tableReader.Close();
}
Andrus
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform