Hello world, I would be grateful if you helped me. I've built a text editing application and I would like it to load values/user settings from the Windows Registry. Here's my code but it is somehow wrong (I believe it whatsoever has to do with wrong syntax but it could be something else);
My form's load event. I could have also posted the code I used to save the settings but it doesn't matter anyway because I ensured it is correct. Still, if you'd like to see that code too, just reply back.
Const c_strKeyName As String = "HKEY_CURRENT_USER\Software\JimmyIliadisInc\NoteEditorPro\" RichTextBox1.Font = CStr(My.Computer.Registry.GetValue(c_strKeyName, "TextFont", "")) WordWrapToolStripMenuItem.CheckState = CStr(My.Computer.Registry.GetValue(c_strKeyName, "WordWrap", "")) RichTextBox1.ForeColor = CStr(My.Computer.Registry.GetValue(c_strKeyName, "TextColor", "")) Me.Text = "Untitled.txt - NoteEditor Pro" Saved = False
OK, here's a detailed explanation. I've got three settings that I want to load. The first one has to do with the font selected before the application was closed and the second has to do with the check state of a menu item (and specifically "Word wrap"). The problem is that this code throws an exception and the settings won't be loaded. Except when I change RichTextBox1.Font to RichTextBox1.Text so it will load ONLY the first setting in plain text (something that does not come in handy). About the third one, I think you can undestand what it's all about. Just wanting to load the text color that was used before the application was closed (doesn't work either). I hope I made things clear. Thanks in advance.