Writing to the registry

Talk2Tom11

Well-known member
Joined
Feb 22, 2004
Messages
144
Location
Westchester, NY
I wanted a value of a key in the registry to equal whatever I typed into a textbox, but when I did that this came out as the value in the registry:

System.Windows.Forms.TextBox, Text: Monday

I only want the value to be "Monday".

this is my code:
Code:
Dim Read As RegistryKey = _
Registry.CurrentUser.CreateSubKey("Year")


        Dim Form1Labels As RegistryKey = _
        Read.CreateSubKey("QuickNotes")
        Form1Labels.SetValue("Note 1", txtBox1)
        Form1Labels.SetValue("Note 2", txtBox2)
        Form1Labels.SetValue("Note 3", txtBox3)
        Form1Labels.SetValue("Note 4", txtBox4)
        Form1Labels.Close()

        Me.Close()
 
well, now that I look at my code... should I have put a .text:
for example

Old
Form1Labels.SetValue("Note 1", txtBox1)

New
Form1Labels.SetValue("Note 1", txtBox1.text)
 
Back
Top