Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / January 2008

Tip: Looking for answers? Try searching our database.

Storing and retrieving font and color settings

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Keon - 23 Jan 2008 14:06 GMT
Is storing ColorDialog.Color as simple as colorDialog.Color.ToString()?
And to retrieve it just get that value that was stored and then use it to
assign your color to wherever you need it.

I have not tried it yet, but I would like to know if that is all it takes.

Thanks
Lasse Vågsæther Karlsen - 23 Jan 2008 14:18 GMT
> Is storing ColorDialog.Color as simple as colorDialog.Color.ToString()?
> And to retrieve it just get that value that was stored and then use it to
[quoted text clipped - 3 lines]
>
> Thanks

1. try it
2. storing it where and how?

Honestly, that minor code example would be faster to try than to write
your original post, let alone the time spent waiting for someone to
write a reply.

Signature

Lasse Vågsæther Karlsen
mailto:lasse@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3

Keon - 23 Jan 2008 17:28 GMT
> 1. try it
> 2. storing it where and how?
>
> Honestly, that minor code example would be faster to try than to write
> your original post, let alone the time spent waiting for someone to write
> a reply.

Appreciate your constructive response, but did it ever occur to you that I
may
not be sitting at a computer with C# on it.  I learned something when I was
a kid,
if you have nothing nice to say, don't say anything.  You might want to try
it one day,
it will make you a better person.
Peter Duniho - 23 Jan 2008 17:49 GMT
> Appreciate your constructive response, but did it ever occur to
> you that I may not be sitting at a computer with C# on it.  I
> learned something when I was a kid, if you have nothing nice to
> say, don't say anything.  You might want to try it one day,
> it will make you a better person.

Something else you should have learned as a kid is "just because it pops  
into your head, that doesn't mean you have to say it".  This applies to  
many posts here, of course.  But it also applies to your first.  If you  
have no way to test the answer, where's the urgency to ask the question?  
Was there any particular reason you felt a need to post a question, the  
answer to which wouldn't have been useful to you anyway?

Lasse's post might have been a bit abrupt, but it had some truth to it as  
well.  Sometimes, it's a good idea to make more of an effort to solve  
something yourself, rather than asking for your hand to be held.  I know  
that the newsgroup sometimes seems more like a cocktail party with casual  
conversations than a straight Q&A forum.  But it's not really the place  
for posting questions that amount essentially to idle curiosity.  If you  
do, occasionally someone might point that out, and they may not  
necessarily suger-coat it.

I don't think there's any point in being offended; just consider that  
there might be some truth in what you're being told and move on.  :)

Pete
Keon - 23 Jan 2008 17:59 GMT
Extremely funny, I always thought the newsgroups were a bunch of people
trying to help each other out.  But I guess it's not, it seems to be a place
to
vent rudeness to each other, then you have people like yourself defending
it.  His response was rude and of no help at all, I am surprised that you
jumped into it to defend him.  You must teach your kids if you have any
to be rude to others and its okay.  It's just a sign of the times we live in
today,
no one respects each other, kids curse out their parents and its okay.
Then you have someone like yourself defending it, does that seem right?
Sine when does defending wrong become right, we are all entitled to bad
days, but thats no excuse to vent it out on others.

Remember one main thing in life, what we do has consequences.  We always
pay for it some way or the other.

Have a great day Pete, you are a big help to this group.
Peter Duniho - 23 Jan 2008 19:03 GMT
> Extremely funny, I always thought the newsgroups were a bunch of people
> trying to help each other out.

They are.  But there are a number of people here who do the bulk of the  
helping, and Lasse is one of them.  Those people can get frustrated when  
people seem to be taking advantage of their generosity.

Even so, I found Lasse's post to be quite well-tempered and  
even-mannered.  I'd hardly call it rude or offensive.

> But I guess it's not, it seems to be a place to
> vent rudeness to each other,

Again, you should calm down and look for the truth in what was written.  
If you're going to go complaining about rudeness, the first thing you need  
to do is make sure you haven't been rude yourself.  If you look at things  
from the point of view of someone other than yourself, you'll see that you  
have been.

> then you have people like yourself defending it.

If you say so.  My point was to try to illustrate how you could have  
handled his response better than posting an abusive rant.  If that's a  
defense of his post, I can live with that.

> His response was rude and of no help at all, I am surprised that you
> jumped into it to defend him.

I didn't find his post all that rude, not did I find it entirely  
unhelpful.  He made a reasonable suggestion ("try it") and even tried to  
solicit more information from you that would help him and others provide  
information that was even more helpful for you.

Ironically, Ignacio's post was pretty much the same, except that he didn't  
offer the additional advice as to how you could be perceived as being less  
rude in the first place.  So technically, his post was _less_ helpful than  
Lasse's.  Yet, you had no qualm with his reply.

> You must teach your kids if you have any
> to be rude to others and its okay.  It's just a sign of the times we  
> live in
> today,
> no one respects each other, kids curse out their parents and its okay.

Actually, I see it as a sign of the times that people seem defenseless,  
unable to do things on their own, asking questions for every little thing  
that comes up rather than taking it upon themselves to put a little effort  
into the problem themselves before trying to get someone else to do the  
work for them.

Sound familiar?

Pete
Keon - 23 Jan 2008 20:27 GMT
> They are.  But there are a number of people here who do the bulk of the
> helping, and Lasse is one of them.  Those people can get frustrated when
> people seem to be taking advantage of their generosity.

I don't know Lasse, I never said hey Lasse can you tell me how to do this?
I posted a simple question with a yes/no answer.  Thats it, very simple.

> Even so, I found Lasse's post to be quite well-tempered and
> even-mannered.  I'd hardly call it rude or offensive.

Of course you wouldn't because thats how you speak to others yourself. How
can you see something wrong when you do the same yourself.  Do as I say
and not as I do.

Sound familiar?

> Again, you should calm down and look for the truth in what was written.
> If you're going to go complaining about rudeness, the first thing you need
> to do is make sure you haven't been rude yourself.  If you look at things

You are right, I was being rude by asking a simple question.  People I am a
rude
person.

> If you say so.  My point was to try to illustrate how you could have
> handled his response better than posting an abusive rant.  If that's a

Okay, you are trying to tell me how to handle my response.  I don't see
anywhere
where are saying Lasse, you should have just said yes or no, you could have
handled it better Lasse.  If Lasse had said to me FU, and try it yourself.
Your
response would have been the same.

> Ironically, Ignacio's post was pretty much the same, except that he didn't
> offer the additional advice as to how you could be perceived as being less

The difference there is he did not act like someone with no upbringing and
decided to speak in whatever tone he wanted.  I bet you money if Lasse was
in my face he would NEVER!!! respond to me like that.  He would simply
say yes you can, or no you cannot.  Being on the computer behind the scenes
seems to give people reasons to be disrespectful whenever they want.  And
you
always have someone who defends it.

Sounds familiar?

> Actually, I see it as a sign of the times that people seem defenseless,
> unable to do things on their own, asking questions for every little thing

Believe me I am not in the slightest way defenseless.  Anyway I am done
with this, I have other things to do like maybe post some more foolish
questions
later because I am too defenseless and need someone to hold my hand hehe.
Peter Duniho - 24 Jan 2008 00:25 GMT
> I don't know Lasse, I never said hey Lasse can you tell me how to do  
> this?

Yes, you did.  When you posted your question to a public newsgroup that  
he's known to read, you did.

The fact that you didn't direct your question straight at him is  
irrelevant.

> I posted a simple question with a yes/no answer.  Thats it, very simple.

And Lasse offered very specific advice as to how you could not only get an  
answer to your question, but how you could avoid looking like you're just  
wasting people's time in the future.

>> Even so, I found Lasse's post to be quite well-tempered and
>> even-mannered.  I'd hardly call it rude or offensive.
>
> Of course you wouldn't because thats how you speak to others yourself.

It's true, Lasse's comment didn't sound a lot different from something I'd  
say myself.  So?

You are being overly sensitive, and frankly extremely arrogant to continue  
to believe that there was absolutely nothing wrong with your own behavior  
in spite of two different people suggesting there was.

> Okay, you are trying to tell me how to handle my response.

I'm trying to offer advice, yes.  You seem too defensive to accept it, but  
it's there nonetheless.

> I don't see anywhere
> where are saying Lasse, you should have just said yes or no, you could  
> have
> handled it better Lasse.

Why should I have?  You're the one who's clearly posting in anger.  What  
point is there in criticizing someone who's just trying to help you?

> If Lasse had said to me FU, and try it yourself.
> Your response would have been the same.

Now you're engaged in lying.  Do you really think that's the behavior of a  
mature, polite individual?

> The difference there is he did not act like someone with no upbringing  
> and
> decided to speak in whatever tone he wanted.

I'm sorry.  I didn't realize you had the voice option enabled on your  
newsreader.

How, exactly, was it that you determined what "tone" it was in which Lasse  
was "speaking"?  Did he actually call you on the phone and read his post  
to you himself?

Again, you are blowing this way out of proportion and reading way too much  
into his post.

> I bet you money if Lasse was
> in my face he would NEVER!!! respond to me like that.

I'd take that bet.  Frankly, I see that sort of comment all the time, but  
the fact is for the most part people write the same words that they would  
say.

What _would_ be different is that you would have heard his actual tone,  
rather than inferring the worst-case scenario yourself.

Another sign of an immature or impolite individual is their inability to  
give someone the benefit of the doubt.  Which is exactly what you're doind  
right now.

> He would simply say yes you can, or no you cannot.

I'd bet he'd tell you to go try it yourself, just as he did here.

> Being on the computer behind the scenes
> seems to give people reasons to be disrespectful whenever they want.

Well, it certainly seems to have given _you_ the feeling that you can be  
disrespectful whenever you want.

Be careful not to project your own personality onto others though.  Not  
everyone thinks or acts the same way you do.  Just because you're being  
disrespectful, that doesn't mean everyone else is.

> And you always have someone who defends it.
>
> Sounds familiar?

Nope.  I'm certainly not defending your disrespectful behavior, if that's  
what you mean.

> Believe me I am not in the slightest way defenseless.

Really?  Then why did you post the question?  Why are you so helpless that  
you need someone else to tell you whether some proposed idea you have  
would work or not?

Frankly, I think both replies were about as helpful as you could have  
expected, and they both basically said "try it".  You've gotten upset over  
nothing.  If nothing else, that's just not good for your health.

Pete
Lasse Vågsæther Karlsen - 25 Jan 2008 09:53 GMT
>> They are.  But there are a number of people here who do the bulk of the
>> helping, and Lasse is one of them.  Those people can get frustrated when
>> people seem to be taking advantage of their generosity.
>
> I don't know Lasse, I never said hey Lasse can you tell me how to do this?
> I posted a simple question with a yes/no answer.  Thats it, very simple.

The problem is that the question could be answered by you, with your
compiler.

I don't understand why you think it's a big deal that I told you to do
that. Yes, I understand you feel offended by the way I worded my
original post, and I apologize for that.

However, you still need to work out the answer to your question. Nothing
in this thread makes me feel even slightly more inclined to tell you
what the answer to your question is.

If you have a more specific question, like "Why doesn't XML
serialization write out a value for my Color properties to the xml
file", then I would answer because you've clearly tried the code, and
still can't figure it out.

> The difference there is he did not act like someone with no upbringing and
> decided to speak in whatever tone he wanted.  I bet you money if Lasse was
> in my face he would NEVER!!! respond to me like that.  He would simply

I think you should leave it to "I don't know Lasse". Ask any of my
collegues, I am like that. If you spend time asking me a question I'm
going to demand that beforehand you've spent time trying it yourself and
coming up short. My time is valuable and while I'm not going to demand
payment for it, I'm going to demand that you "pay" by spending time not
imposing on it. I'm assuming (and maybe this was where I went wrong)
that this goes for most people on this (and other) newsgroup.

Just to conclude my answers to this thread and then I'm going to leave
it: Your *first* reaction to a code problem should never be to ask
someone else. Your *first* reaction should be to try it.

Signature

Lasse Vågsæther Karlsen
mailto:lasse@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3

Keon - 25 Jan 2008 15:41 GMT
Lasse,

I do apologize myself for being a bit sensitive.  But at the moment
when I posted the question, I was not at a pc to actually try it.  I
wanted to store those settings from an app and read it back in.
But I was thinking to myself it could not be that easy, because as
far as I remember, you always had to store font and color settings
as 0XFF etc in  a hex format.

I did try looking to see what the color would look like when you
do a ToString() on the colordialog.  But when I saw something like
"ColorDialog [Green]" I was thinking that is not going to work.  I
still have not tried reading the value back into a colordialog to see
if it actually works.

So really there is no urgency, I just wanted to know if this is actually
going to work like that?

Plus before I post any questions I pull up the help file and do a search
to see what I can find.  Because I know someone before me had already
asked the same question.

Lasse, thanks again for your help.

Sometimes its tough when I see and hear people at work being spoken to
like idiots.  I respect and laugh and joke with everyone no matter if I am
in a
good mood or not.  That is until someone decides to disrespect me, which is
very rare because I don't put up with it.  So I mostly find myself standing
up
and defending others.  It seems I am always telling others to treat others
the
way they want to be treated.  I defend myself instantly, so I get the
respected
treatment.  Being around a lot of really good managers I see how people
should
be treated, with great respect.

Pete wouldn't understand that.

As far as I am concerned this conversation is over.  Lasse, I am sorry, I
apologize.

The End.

p.s. Pete, you can carry on if you want which I know you will.
Peter Duniho - 25 Jan 2008 19:11 GMT
> [...]
> Pete wouldn't understand that.

Your hypocrisy, while not surprising, is still impressive.

You are the only person in this thread to have made any personal insults.  
Including the above.  And yet you act as though you're the one taking the  
high road, the person with the last word on treating people with respect.

It'd be funny, if it weren't so pitiful.

Pete
Lasse Vågsæther Karlsen - 25 Jan 2008 09:48 GMT
> Extremely funny, I always thought the newsgroups were a bunch of people
> trying to help each other out.  But I guess it's not, it seems to be a place
> to

No, it is definitely a place to help people out.

However, we can't help you with *everything* and at some point you're
going to take up the stick and do some dirty work yourself.

When the original question is "does this code work?", basically, my
question will always be: Well, did it? Or similar.

> vent rudeness to each other, then you have people like yourself defending
> it.  His response was rude and of no help at all, I am surprised that you

Yes, I was probably a bit rude, I apologize for that, but my answer
still stands. I could probably have worded it a bit less rude, but you
should, for this particular question, try the code.

> jumped into it to defend him.  You must teach your kids if you have any
> to be rude to others and its okay.  It's just a sign of the times we live in
> today,

If you're going to go down that route... well, ok. Teaching kids that it
is ok to ask questions, but not to try things out themselves, is that right?

You took the time to write a post, but you didn't take the time to just
write less inside a compiler to try it. In that case you were rude to
impose your problem on our time instead of using your own time.

Signature

Lasse Vågsæther Karlsen
mailto:lasse@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3

Lasse Vågsæther Karlsen - 25 Jan 2008 09:46 GMT
>> 1. try it
>> 2. storing it where and how?
[quoted text clipped - 10 lines]
> it one day,
> it will make you a better person.

While I did post abrupy, like Peter says, my point was not to "not say
something". My point was that there are about a million things each day
(yes, exaggerated) that I wonder about, but if I didn't take the time to
find them out myself, or at least a lot of them, I would ask questions
about everything.

There's no substitute from raw experience and your first reaction to a
problem should always be how to figure it out yourself, unless the
problem is so big that you don't even know where to start.

In your particular case you're asking about something where you've even
gone to the trouble of writing example code. It should not take much
more effort on your part to simply test that code.

If I shouldn't answer so abruptly, my first question would instead be:
When you tried that code, what happened? Why did it not solve your problem?

Signature

Lasse Vågsæther Karlsen
mailto:lasse@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3

Ignacio Machin ( .NET/ C# MVP ) - 23 Jan 2008 15:23 GMT
Did you try something as easy as
string s = Color.ToString();

Take a look at Color.FromXXXX methods

Signature

Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.

> Is storing ColorDialog.Color as simple as colorDialog.Color.ToString()?
> And to retrieve it just get that value that was stored and then use it to
[quoted text clipped - 3 lines]
>
> Thanks
Keon - 23 Jan 2008 17:30 GMT
Appreciate it, I really didn't think it was that easy.  I wanted to make
sure, but I am now sitting at my pc where I can try it.

Thanks.

> Did you try something as easy as
> string s = Color.ToString();
[quoted text clipped - 9 lines]
>>
>> Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.