Click here to Skip to main content
15,912,400 members
Home / Discussions / Visual Basic
   

Visual Basic

 
General[Message Deleted] Pin
Amr M. K.16-Sep-05 2:53
Amr M. K.16-Sep-05 2:53 
GeneralRe: Save in when load Pin
enjoycrack16-Sep-05 3:03
enjoycrack16-Sep-05 3:03 
GeneralRe: Save in when load Pin
Amr M. K.16-Sep-05 3:36
Amr M. K.16-Sep-05 3:36 
GeneralRe: Save in when load Pin
Amr M. K.16-Sep-05 3:37
Amr M. K.16-Sep-05 3:37 
GeneralRe: Save in when load Pin
Dave Kreskowiak16-Sep-05 14:08
mveDave Kreskowiak16-Sep-05 14:08 
GeneralRe: Save in when load Pin
Gopi.V16-Sep-05 23:04
Gopi.V16-Sep-05 23:04 
GeneralRe: Save in when load Pin
Amr M. K.17-Sep-05 9:39
Amr M. K.17-Sep-05 9:39 
GeneralRe: Save in when load Pin
Jerry___18-Sep-05 8:20
Jerry___18-Sep-05 8:20 
The following code should work:
-Make an appform with 2 textboxes: TextBox1 and TextBox2.
-Add two buttons: btnSaveSettings and btnGetSettings.
-code for btnSaveSettings: SaveMyNumber()
-code for btnGetSettings: GetMynumber()
-DONE!

-enter text in TextBox1 > press savesettings
-press get settings and the nuber you entered in TextBox1 should appear in TextBox2!
-if you restart your computer, run the app, press getsettings your saved text will be shown again.

<br />
Imports Microsoft.Win32<br />
<br />
Dim MyNumber as string<br />
Dim MainKey As RegistryKey = Registry.CurrentUser.OpenSubKey("Software", True)<br />
Dim MyKey As RegistryKey = MainKey.CreateSubKey("MyKey")<br />
<br />
Private Sub SaveMyNumber()<br />
  If not TextBox1.text = "" then<br />
     MyNumber = TextBox1.text<br />
     MyKey.SetValue("MyValue", MyNumber)<br />
  else<br />
  exit sub<br />
  end if<br />
End Sub<br />
<br />
Private Sub GetMyNumber()<br />
    TextBox2.text = MyKey.GetValue("MyValue")<br />
End Sub<br />


Next you can check your value in the registry:
-Start > run > type "regedit" and press enter.
-open HKEY_CURRENTUSER > SoftWare > MyKey and there it is!
You just created this key.
You can delete it (MyKey) by right clicking on MyKey and select Delete, but beware!!! dont delete the wrong keys, it messes up your system!
GeneralRe: Save in when load Pin
Amr M. K.17-Sep-05 9:38
Amr M. K.17-Sep-05 9:38 
GeneralRe: Save in when load Pin
Dave Kreskowiak18-Sep-05 1:30
mveDave Kreskowiak18-Sep-05 1:30 
QuestionQuery more than 2 tables Pin
phokojoe16-Sep-05 2:33
phokojoe16-Sep-05 2:33 
AnswerRe: Query more than 2 tables Pin
enjoycrack16-Sep-05 2:54
enjoycrack16-Sep-05 2:54 
AnswerRe: Query more than 2 tables Pin
Anonymous19-Sep-05 15:32
Anonymous19-Sep-05 15:32 
QuestionThreading... Pin
Anonymous16-Sep-05 1:56
Anonymous16-Sep-05 1:56 
AnswerRe: Threading... Pin
rwestgraham16-Sep-05 6:11
rwestgraham16-Sep-05 6:11 
QuestionDatabase Problem (Access) Pin
AliAmjad16-Sep-05 1:48
AliAmjad16-Sep-05 1:48 
AnswerRe: Database Problem (Access) Pin
KaptinKrunch16-Sep-05 6:28
KaptinKrunch16-Sep-05 6:28 
QuestionHow to edit data in a datagrid? Pin
aruljothi15-Sep-05 23:01
aruljothi15-Sep-05 23:01 
AnswerRe: How to edit data in a datagrid? Pin
dptalt16-Sep-05 2:17
dptalt16-Sep-05 2:17 
Questionsockets vb Pin
_tasleem15-Sep-05 22:51
_tasleem15-Sep-05 22:51 
AnswerRe: sockets vb Pin
Dave Kreskowiak16-Sep-05 1:52
mveDave Kreskowiak16-Sep-05 1:52 
GeneralRe: sockets vb Pin
_tasleem16-Sep-05 20:42
_tasleem16-Sep-05 20:42 
Questionhow to add toolbars in datagrid? Pin
Member 223436015-Sep-05 18:35
Member 223436015-Sep-05 18:35 
QuestionDirectory List in VB.Net Pin
Anonymous15-Sep-05 18:32
Anonymous15-Sep-05 18:32 
AnswerRe: Directory List in VB.Net Pin
rwestgraham15-Sep-05 18:49
rwestgraham15-Sep-05 18:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.