473,385 Members | 1,661 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to manage asp.net color?

ad

I cant to write a function to manage the font color of my web.
The function is like:
using System.Drawing;
public static string FontColor(string sInput, Color myColor)
{
string sRV = "";
sRV = "<font color='" + myColor.ToString() + "'>" + sInput + "</font>";
return sRV;
}

but when I use
FontColor("Test", Color.Red) to call the function,
The return string is
<font color='Color [Red]'>Test</font></font><br>

The color is mistake.

I think I use the wrong namespace.

How can I manage the HTML color?
Nov 19 '05 #1
2 966
"ad" <ad@wfes.tcc.edu.tw> wrote in news:eldXYaFpFHA.3064
@TK2MSFTNGP15.phx.gbl:
How can I manage the HTML color?


Most controls have a forecolor property.

Otherwise CSS.

Or use a literal/HTMLGenericControl control

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #2
ad wrote:
I cant to write a function to manage the font color of my web.
The function is like:
using System.Drawing;
public static string FontColor(string sInput, Color myColor)
{
string sRV = "";
sRV = "<font color='" + myColor.ToString() + "'>" + sInput + "</font>";
return sRV;
}

but when I use
FontColor("Test", Color.Red) to call the function,
The return string is
<font color='Color [Red]'>Test</font></font><br>

The color is mistake.

I think I use the wrong namespace.

How can I manage the HTML color?


Look at the ColorTranslator class - it has static methods for
translating Color objects to other formats. For instance, it has a
ToHtml() method.

Damien

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bob Bedford | last post by:
We are 3 persons contacting various potential clients/customers and also potential advertisers for our website. Each person work at home, and it becomes ever difficult to manage our contacts....
4
by: Tonya | last post by:
Hi, Does anyone have any example of how i can manage forms in my application?? I want to be able to reference my form instances that are currently open from other forms. why cant i open...
3
by: Daniele | last post by:
Hi, My problem is the manage of a dynamic vector in a list of structures. In the .hpp file I define the struct and the vector v. typedef struct Word { char* Name; vector<int> v; Word* Next;...
0
by: Earl Teigrob | last post by:
I am currently using native .net XML classes for managing my little key/value data storage requirements and they work great. I have created a simple class to abstract the XML and manage my...
1
by: UnixUser | last post by:
I am looking for help in creating a buffer of approximately 4000 to 8000 bytes that i could manage like a com port. Other programs would need to know the address of the buffer so that they could...
2
by: Champika Nirosh | last post by:
Hi All, Do any of you know a pure manage control, that render html pages. I know microsoft web browser com, but it is not a manage one. Thanks, Nirosh.
1
by: Osvaldo Bisignano | last post by:
Hi guys, I wonder if there's any namespace or class within the framework that allows me to create a new c# project by code, manage its references, and build it from another C# application. I'm not...
3
by: Max2006 | last post by:
Hi, I am using asp.net 2 SQL membership provider. Is there any tool or application that helps me manage my users' password? I am trying to do that without writing any code.
1
by: duit889 | last post by:
How To Manage SMS With PHP -------------------------------------------------------------------------------- How To Manage SMS With PHP 1. Do anyone know how to manage Inbox and sent message...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.