mrdutchie Posted July 18, 2003 Posted July 18, 2003 (edited) [PLAIN]Reading Color values from registry won't work? Help! [resolved][/PLAIN] Hello, I created some entries in the registry where I want to save my colors. It saves it in the registry as Name: Background Type: REG_DWORD Data: ff400000 When I try to read it with regKey = Registry.LocalMachine.OpenSubKey("Software\testprogram\colors", True) msgbox(regKey.GetValue("background")) I am getting a value of -12345902 I can't figure out how to get the "ff400000" value then the other problem is how can I put it back as a background color Me.BackColor = "ff400000" won't work.. Can someone help me with these 2 little problems. Thanks so much. Edited July 18, 2003 by mrdutchie Quote
Leaders dynamic_sysop Posted July 18, 2003 Leaders Posted July 18, 2003 here's way 1 ( the value you get is the Integer value of the ffxxxx ) Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.BackColor = Color.FromArgb(-12345902) End Sub Quote
Leaders dynamic_sysop Posted July 18, 2003 Leaders Posted July 18, 2003 also you can convert html colors etc ... Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim c As ColorTranslator Dim i As Color = c.FromHtml("#ff400000") Me.BackColor = i End Sub Quote
mrdutchie Posted July 18, 2003 Author Posted July 18, 2003 (edited) Fixed it... Thanks so much Edited July 18, 2003 by mrdutchie Quote
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.