Click here to Skip to main content
15,886,578 members
Articles / Desktop Programming / Windows Forms

Creating a Custom Settings Provider

Rate me:
Please Sign up or sign in to vote.
4.52/5 (19 votes)
17 Oct 2007CPOL3 min read 250K   10.1K   79  
Demonstration of how to write custom settings providers.
Public Class Form1

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Me.Location = My.Settings.WindowLocation
        Me.ClientSize = My.Settings.WindowSize

        Me.TextBox1.Text = My.Settings.UserWord

    End Sub

    Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        If Me.WindowState = FormWindowState.Normal Then
            My.Settings.WindowLocation = Me.Location
            My.Settings.WindowSize = Me.ClientSize
        End If

        My.Settings.UserWord = Me.TextBox1.Text
    End Sub
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United Kingdom United Kingdom
A general purpose analyst programmer working in a small development team for a company in the city.

VB has always been my passion and I code both Win forms and web based systems for both work and fun.

Comments and Discussions