Click here to Skip to main content
15,891,184 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: it Works.. URGENT Pin
Amalarajan20-Oct-05 8:04
Amalarajan20-Oct-05 8:04 
GeneralRe: it Works.. URGENT Pin
Christian Graus20-Oct-05 10:03
protectorChristian Graus20-Oct-05 10:03 
QuestionRemoving Handler... URGENT Pin
Shubhabrata Mohanty15-Oct-05 16:14
Shubhabrata Mohanty15-Oct-05 16:14 
AnswerRe: Removing Handler... URGENT Pin
S. Senthil Kumar15-Oct-05 23:33
S. Senthil Kumar15-Oct-05 23:33 
GeneralRe: Removing Handler... URGENT Pin
Shubhabrata Mohanty16-Oct-05 10:39
Shubhabrata Mohanty16-Oct-05 10:39 
QuestionTransparent Text lable without showing form Pin
Member 230469115-Oct-05 16:05
Member 230469115-Oct-05 16:05 
QuestionRe: Setup Pin
Anonymous15-Oct-05 0:07
Anonymous15-Oct-05 0:07 
AnswerRe: Setup Pin
Jerry___15-Oct-05 5:17
Jerry___15-Oct-05 5:17 
The following code shows how to use the registry:
-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.


Imports Microsoft.Win32

Dim MyNumber as string
Dim MainKey As RegistryKey = Registry.CurrentUser.OpenSubKey("Software", True)
Dim MyKey As RegistryKey = MainKey.CreateSubKey("MyKey")

Private Sub SaveMyNumber()
If not TextBox1.text = "" then
MyNumber = TextBox1.text
MyKey.SetValue("MyValue", MyNumber)
else
exit sub
end if
End Sub

Private Sub GetMyNumber()
TextBox2.text = MyKey.GetValue("MyValue")
End Sub


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!

if you use datetime.today in sub formload, save this in the registry the first time you load the program, the only thing you need to do is figure out how to do this only the first time you load the program. This shouldn't be so difficult.

Hope this helped you,
Cheers.


AnswerRe: Setup Pin
rwestgraham15-Oct-05 9:49
rwestgraham15-Oct-05 9:49 
QuestionListbox With data Pin
_mubashir14-Oct-05 23:56
_mubashir14-Oct-05 23:56 
QuestionMultiple Links in Tables Cells in MS Word Pin
padmakumarg14-Oct-05 22:17
padmakumarg14-Oct-05 22:17 
QuestionHeadings in MS Word. Pin
padmakumarg14-Oct-05 22:10
padmakumarg14-Oct-05 22:10 
QuestionTextbox to Textbox ? Pin
Anonymous14-Oct-05 17:39
Anonymous14-Oct-05 17:39 
AnswerRe: Textbox to Textbox ? Pin
jo0ls15-Oct-05 12:12
jo0ls15-Oct-05 12:12 
GeneralRe: Textbox to Textbox ? Pin
Anonymous15-Oct-05 14:49
Anonymous15-Oct-05 14:49 
QuestionRead from txt file Pin
kenexcelon14-Oct-05 14:41
kenexcelon14-Oct-05 14:41 
AnswerRe: Read from txt file Pin
kenexcelon14-Oct-05 15:30
kenexcelon14-Oct-05 15:30 
AnswerRe: Read from txt file Pin
kenexcelon15-Oct-05 15:58
kenexcelon15-Oct-05 15:58 
QuestionMoving on from For statements Pin
Dr. Pool14-Oct-05 12:54
Dr. Pool14-Oct-05 12:54 
AnswerRe: Moving on from For statements Pin
Dr. Pool15-Oct-05 3:32
Dr. Pool15-Oct-05 3:32 
QuestionRegistries : i want to make a app same as regedit Pin
varun conday14-Oct-05 9:53
varun conday14-Oct-05 9:53 
Questionconverting .exe to source code Pin
Anonymous14-Oct-05 9:13
Anonymous14-Oct-05 9:13 
AnswerRe: converting .exe to source code Pin
Dave Kreskowiak14-Oct-05 12:15
mveDave Kreskowiak14-Oct-05 12:15 
AnswerRe: converting .exe to source code Pin
Amr M. K.19-Oct-05 4:25
Amr M. K.19-Oct-05 4:25 
QuestionRandom Numbers Pin
icouldntthinkofagoodname14-Oct-05 7:49
icouldntthinkofagoodname14-Oct-05 7: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.