Click here to Skip to main content
15,920,896 members
Home / Discussions / C#
   

C#

 
GeneralRe: Directory Picker Pin
Heath Stewart19-Apr-04 3:40
protectorHeath Stewart19-Apr-04 3:40 
GeneralRe: Directory Picker Pin
bertcox19-Apr-04 4:03
bertcox19-Apr-04 4:03 
Generalc++ client for c# server Pin
rana7419-Apr-04 2:04
rana7419-Apr-04 2:04 
GeneralRe: c++ client for c# server Pin
Heath Stewart19-Apr-04 3:17
protectorHeath Stewart19-Apr-04 3:17 
GeneralRe: c++ client for c# server Pin
rana7419-Apr-04 18:12
rana7419-Apr-04 18:12 
GeneralRe: c++ client for c# server Pin
Heath Stewart20-Apr-04 3:17
protectorHeath Stewart20-Apr-04 3:17 
GeneralConvert from string to Color Pin
Member 74394419-Apr-04 1:49
Member 74394419-Apr-04 1:49 
GeneralRe: Convert from string to Color Pin
Heath Stewart19-Apr-04 3:22
protectorHeath Stewart19-Apr-04 3:22 
The ColorConverter converts either color names (from the KnownColors enumeration) or hex values with or without the pound (#) sign. That should work when you read the string using AppSettings["ColorClosed"] (no need to call ToString, BTW, since it already is a string and - if it's not in your .config file - would return null thus throwing a NullReferenceException. If you want to store colors using the R,G,B notation, then you'll need to split the strigs, convert them to ints, and use Color.FromArgb, which you seem to be doing.

Since you didn't tell us what the actual problem is (i.e., what Exception is thrown and what the message is), all I can do is guess that your .config file isn't 1) named correct (should be YourAppName.exe.config), and/or 2) isn't in the same directory as the application. The best thing is to step through your code and check the state of each variable. It also helps to split your longer statements into shorter ones - the compiler will do that anyway so there's no loss in performance.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Convert from string to Color Pin
Member 74394419-Apr-04 3:40
Member 74394419-Apr-04 3:40 
GeneralRe: Convert from string to Color Pin
Heath Stewart19-Apr-04 4:01
protectorHeath Stewart19-Apr-04 4:01 
GeneralConvert from string to Color Pin
Member 74394419-Apr-04 1:44
Member 74394419-Apr-04 1:44 
GeneralRe: Convert from string to Color Pin
Mike Ellison19-Apr-04 4:07
Mike Ellison19-Apr-04 4:07 
QuestionCan Fill? Pin
wokankan19-Apr-04 1:33
wokankan19-Apr-04 1:33 
AnswerRe: Can Fill? Pin
mhmoud rawas19-Apr-04 2:11
mhmoud rawas19-Apr-04 2:11 
GeneralRe: Can Fill? Pin
wokankan19-Apr-04 2:45
wokankan19-Apr-04 2:45 
GeneralRe: Can Fill? Pin
Heath Stewart19-Apr-04 3:23
protectorHeath Stewart19-Apr-04 3:23 
AnswerRe: Can Fill? Pin
Heath Stewart19-Apr-04 3:26
protectorHeath Stewart19-Apr-04 3:26 
GeneralRe: Can Fill? Pin
wokankan19-Apr-04 4:21
wokankan19-Apr-04 4:21 
GeneralNavigating tabs with MDI Application Pin
Jon G19-Apr-04 1:02
Jon G19-Apr-04 1:02 
GeneralRe: Navigating tabs with MDI Application Pin
Dave Kreskowiak19-Apr-04 1:31
mveDave Kreskowiak19-Apr-04 1:31 
GeneralRe: Navigating tabs with MDI Application Pin
Jon G19-Apr-04 1:35
Jon G19-Apr-04 1:35 
GeneralRe: Navigating tabs with MDI Application Pin
Heath Stewart19-Apr-04 3:28
protectorHeath Stewart19-Apr-04 3:28 
GeneralIf and or Pin
Appelz19-Apr-04 0:12
Appelz19-Apr-04 0:12 
GeneralRe: If and or Pin
Colin Angus Mackay19-Apr-04 0:25
Colin Angus Mackay19-Apr-04 0:25 
GeneralHave a writable datagrid using an mdb Pin
Gian18-Apr-04 23:19
Gian18-Apr-04 23:19 

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.