Results 1 to 2 of 2

Thread: [VB2008] Import My.Settings from previous build version

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2010
    Location
    United Kingdom
    Posts
    115

    [VB2008] Import My.Settings from previous build version

    I am using this in Visual Basic 2008 Express Edition but it may work in other versions.

    The following will allow you to automatically import your settings from a previous build version of an application.

    Firstly go to Project Properties and click on the Settings tab.

    Next add a new setting with the following parameters:
    Name: IUpgraded
    Type: Boolean
    Scope: User
    Value: False

    In the form_load event of your startup form (not the splashscreen if you're using one) add the following code before any other code:

    Code:
    If Not My.Settings.lUpgraded Then
                My.Settings.Upgrade()
                My.Settings.lUpgraded = 1
                MsgBox("Your  settings have been imported from the previous build version.", MsgBoxStyle.Information, "Upgrade Complete")
            End If
    This works by copying your settings from the previous build then changing the value of the IUpgraded setting from False to True.
    Regards
    Colin

    If my comments helped please remember to add to my reputation using Rate This Post.

    If your problem has been resolved please mark the thread resolved using the "Mark Thread Resolved" link in thread tools.

    CodeBank Submissions: 1) WebBrowser - Delete cookies etc 2) Import My.Settings from previous build version

  2. #2
    New Member
    Join Date
    Jan 2011
    Posts
    1

    Re: [VB2008] Import My.Settings from previous build version

    Thanks, never knew that.

    Works perfectly in VB2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width