aewarnick Posted March 9, 2003 Posted March 9, 2003 The form is supposed to be mostly tan with bluish text boxes but it ends up being pink and grey. What is going on? Quote C#
Moderators Robby Posted March 10, 2003 Moderators Posted March 10, 2003 Are you using System colors? or ? Quote Visit...Bassic Software
aewarnick Posted March 10, 2003 Author Posted March 10, 2003 No. I am using any color- chosen with the VS colorDialog. Quote C#
Moderators Robby Posted March 10, 2003 Moderators Posted March 10, 2003 Perhaps you can add/change the colors at run-time using the Color.FromArgb() method. Quote Visit...Bassic Software
aewarnick Posted March 10, 2003 Author Posted March 10, 2003 The registry is where the colors are read from: CommunicationLog.RegColors.SetValue("TBsColor", this.colorDialog.Color.ToArgb()); and I use FromArgb() to get them. So I guess, in answer to your question, I already do that. Quote C#
Moderators Robby Posted March 10, 2003 Moderators Posted March 10, 2003 Could it be a video card(setting) or monitor issue? Quote Visit...Bassic Software
aewarnick Posted March 10, 2003 Author Posted March 10, 2003 (edited) I don't know, some of the values are set like this: CommunicationLog.RegColors.SetValue("LogBoxColor", ColorTranslator.FromHtml("#fff8f9d9").ToArgb()); and the values in the registry are saved like this: 0xffebe4cf (4293649615) Maybe the FromHtml part is a problem, but like I said it is only on other computers and not at all on this one. I have tried win 98 and win xp home and got the same messed up colors. Except I think that the xp have a grey back instead of pink. I also just tried this, I set the value with: CommunicationLog.RegColors.SetValue("LogBoxColor", ColorTranslator.FromHtml("#fff8f9d9").Name); //string value in registry - fff8f9d9 and retrieved it with: this.LogBox.BackColor=Color.FromName(RegColors.GetValue("LogBoxColor").ToString()); and I got the same exact results. Edited March 10, 2003 by aewarnick Quote C#
Moderators Robby Posted March 10, 2003 Moderators Posted March 10, 2003 You have too many digits im all your values (fff8f9d9). Quote Visit...Bassic Software
aewarnick Posted March 10, 2003 Author Posted March 10, 2003 I don't think I do because when I remove just one letter it catches it in my try-catch. And it always works perfect on this computer but not on any other. Quote C#
aewarnick Posted March 10, 2003 Author Posted March 10, 2003 You are right about them being too long for html colors but they work fine that way and I just tried to use a true html color and the same problem persists. I think it is wierd how it only works on my computer. Quote C#
aewarnick Posted March 10, 2003 Author Posted March 10, 2003 I tried putting this color in place of my original code: 0000ff. It is the color Blue, not any exotic color like the others. It saves in the registry like this: 0xff0000ff and it works perfectly. But I do not want to use normal colors. The user needs to be able to pick any color under the sun. Any ideas as to why only known colors work? Quote C#
aewarnick Posted March 10, 2003 Author Posted March 10, 2003 (edited) I also tried it this way (with the long html color): CommunicationLog.RegColors.SetValue("FormBackColor", ColorTranslator.FromHtml("#ff0000ff").ToArgb()); and it works perfecly on both computers. But I cannot be restricted to just known colors. I also, just tried using the colors I chose in VS and not loading from any registry settings at all but the colors are grey now instead of pink. There has to be something installed on my computer that is not installed on others. Maybe xp professional has some kind of color wheel that win 98 does not. Edited March 10, 2003 by aewarnick Quote C#
*Experts* Nerseus Posted March 10, 2003 *Experts* Posted March 10, 2003 Are you both using 16bit or 32bit color, or is the other machine running only 256 colors or less? A value with 8 hex digits is fine, by the way. The first pair represents the alpha component, usually FF (255 - or pure white, opaque). If you chop off the first two hex digits the remaining 6 make up the red, green, and blue. If someone is running fewer than 16bit color, a dithering may be applied which means you may not get the exact same color on other machines. Standard colors, including standard Web colors, have a better chance of working but anything but the base 16 colors have no guarantee to work exactly. I can see no reason why the values would otherwise show up differently on one machine versus another. Have you verified that the colors being read in by the other machine is the same value as the one on your machine? -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
aewarnick Posted March 10, 2003 Author Posted March 10, 2003 That was the problem, the other machines were running 256 color and not 16 bit. Thank you very much! The frustration and confusion is now over. Is there a way that I can automatically set the resolution on a computer to 16 bit in my code? Quote C#
aewarnick Posted March 10, 2003 Author Posted March 10, 2003 How to set (Default) value in registry? I tried: SetValue("(Default)", "C:\\WINDOWS\\rundll32.exe shell32.dll,OpenAs_RunDLL %1"); Quote C#
aewarnick Posted March 10, 2003 Author Posted March 10, 2003 Never mind: SetValue("", "C:\\WINDOWS\\rundll32.exe shell32.dll,OpenAs_RunDLL %1"); Just set the value name to nothing. Quote C#
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.