Click here to Skip to main content
15,898,035 members
Home / Discussions / C#
   

C#

 
AnswerRe: At runtime find the application's build version? Pin
Dougie the P5-Aug-09 16:03
professionalDougie the P5-Aug-09 16:03 
AnswerRe: At runtime find the application's build version? Pin
Cracked-Down5-Aug-09 19:41
Cracked-Down5-Aug-09 19:41 
GeneralRe: At runtime find the application's build version? Pin
JollyMansArt5-Aug-09 20:59
JollyMansArt5-Aug-09 20:59 
QuestionChange Headers in DataGridView [modified] Pin
petermar5-Aug-09 6:01
petermar5-Aug-09 6:01 
Questionchecking a string format? Pin
will kirkby5-Aug-09 5:53
will kirkby5-Aug-09 5:53 
AnswerRe: checking a string format? Pin
Simon P Stevens5-Aug-09 5:59
Simon P Stevens5-Aug-09 5:59 
AnswerRe: checking a string format? Pin
musefan5-Aug-09 7:03
musefan5-Aug-09 7:03 
GeneralRe: checking a string format? Pin
Luc Pattyn5-Aug-09 8:14
sitebuilderLuc Pattyn5-Aug-09 8:14 
That is terrible. I see magic constants, a major bug (|| instead of &&) and no acceptance of lower-case hex.

I would suggest:
public static bool ValidateColor(string s, out int value) {
    return s!=null && s.Length==6 && int.TryParse(s, out value, NumberStyles.HexNumber);
}


Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: checking a string format? Pin
musefan5-Aug-09 21:53
musefan5-Aug-09 21:53 
Questionhow to monitor internet explorer using c# Pin
msgreat5-Aug-09 5:40
msgreat5-Aug-09 5:40 
AnswerRe: how to monitor internet explorer using c# Pin
msgreat5-Aug-09 6:32
msgreat5-Aug-09 6:32 
GeneralRe: how to monitor internet explorer using c# Pin
todorm3-Sep-09 6:22
todorm3-Sep-09 6:22 
Questionthe code in this article[our codeproject article only] not working in my visual studio 2008 Pin
msgreat5-Aug-09 5:20
msgreat5-Aug-09 5:20 
QuestionHow to find out if an object type supports a given arithmetic operator Pin
Duncan Edwards Jones5-Aug-09 4:57
professionalDuncan Edwards Jones5-Aug-09 4:57 
AnswerRe: How to find out if an object type supports a given arithmetic operator Pin
Luc Pattyn5-Aug-09 5:03
sitebuilderLuc Pattyn5-Aug-09 5:03 
GeneralRe: How to find out if an object type supports a given arithmetic operator Pin
Duncan Edwards Jones5-Aug-09 5:37
professionalDuncan Edwards Jones5-Aug-09 5:37 
GeneralRe: How to find out if an object type supports a given arithmetic operator Pin
Luc Pattyn5-Aug-09 5:51
sitebuilderLuc Pattyn5-Aug-09 5:51 
AnswerRe: How to find out if an object type supports a given arithmetic operator Pin
PIEBALDconsult5-Aug-09 9:19
mvePIEBALDconsult5-Aug-09 9:19 
QuestionProblem when reading single numeric values from an Excel worksheet Pin
KeesDekker5-Aug-09 4:50
KeesDekker5-Aug-09 4:50 
AnswerRe: Problem when reading single numeric values from an Excel worksheet Pin
Eddy Vluggen5-Aug-09 5:03
professionalEddy Vluggen5-Aug-09 5:03 
GeneralRe: Problem when reading single numeric values from an Excel worksheet Pin
KeesDekker5-Aug-09 22:01
KeesDekker5-Aug-09 22:01 
QuestionFast messages not sent through TcpClient Pin
bocsiboti5-Aug-09 4:29
bocsiboti5-Aug-09 4:29 
AnswerRe: Fast messages not sent through TcpClient Pin
Ennis Ray Lynch, Jr.5-Aug-09 4:54
Ennis Ray Lynch, Jr.5-Aug-09 4:54 
GeneralRe: Fast messages not sent through TcpClient Pin
bocsiboti6-Aug-09 3:04
bocsiboti6-Aug-09 3:04 
GeneralRe: Fast messages not sent through TcpClient Pin
Ennis Ray Lynch, Jr.6-Aug-09 6:06
Ennis Ray Lynch, Jr.6-Aug-09 6:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.