Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Sep 21, 2019 8:41 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: App - GetSettings SaveSettings
PostPosted: Sun Dec 04, 2011 7:02 pm 
Offline
User avatar

Joined: Sat May 27, 2006 3:27 pm
Posts: 480
Hello
here is a simple way to save and get your application settings from the user registry. This is same way that Visual Basic uses. Hope this helps!

VB Code

Quote:


RB Code

Sub GetSettings( frm As Window )
' Get the form's size and position.
Dim Reg As RegistryItem
Reg = New RegistryItem("HKEY_CURRENT_USER\Software\AppWinSettings")

frm.Left = Reg.Value("Left")
frm.Top = Reg.Value("Top")
frm.Width = Reg.Value("Width")
frm.Height = Reg.Value("Height")
frm.Placement = Reg.Value("WindowState")
End Sub


Sub SaveSettings( frm As Window )
' Save the form's size and position.
Dim Reg As RegistryItem
Reg = New RegistryItem("HKEY_CURRENT_USER\Software\AppWinSettings")

Reg.Value("Left") = frm.Left
Reg.Value("Top") = frm.Top
Reg.Value("Width") = frm.Width
Reg.Value("Height") = frm.Height
Reg.Value("WindowState") = frm.Placement
End Sub


Window Sub_Open()
Dim Reg As RegistryItem
Reg = New RegistryItem("HKEY_CURRENT_USER\Software\AppWinSettings")

If Reg.keyCount = 0 Then
Exit
Else
GetSettings( Me )
End
End Sub


Window Sub_Close()
SaveSettings( Me )
End Sub


Top
 Profile  
Reply with quote  
 Post subject: Re: App - GetSettings SaveSettings
PostPosted: Mon Jan 09, 2012 11:29 am 
Offline
User avatar

Joined: Wed Oct 06, 2010 10:25 am
Posts: 154
Location: ---
Sure! It will be very usefull for me.
Good tip.
Thanks,
Max (Eudosia)

_________________
Massimiliano Fabbri
Freelance Senior Programmer
(Eudosia Systems)
Visual Basic 6 - RealStudio - Mobile Development
Php5/Mysql - Dot Net C# - Objective C
-------------------------------------------
http://www.eudosia-systems.it


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group