Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set values of two properties in other method
Message
From
18/02/2007 11:18:09
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
How to set values of two properties in other method
Miscellaneous
Thread ID:
01196933
Message ID:
01196933
Views:
57
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
Next
Reply
Map
View

Click here to load this message in the networking platform