View Poll Results: Did this help you?

Voters
6. This poll is closed
  • No, but I'm sure it helped someone thanks for posting

    4 66.67%
  • No, this is just a waste of thread space.

    1 16.67%
  • Thanks! So Much Easier then saving a Config File.

    0 0%
  • Thank You, Keep up the good work.

    1 16.67%
Results 1 to 6 of 6
  1. #1
    CoderNever's Avatar
    Join Date
    Feb 2009
    Gender
    female
    Location
    https://mpgh.net MPGHCash: $700,458,011
    Posts
    1,198
    Reputation
    131
    Thanks
    2,236
    My Mood
    Buzzed

    Visual Basics - Using Settings

    Note : All Colors In Plain Text Refers to the Last Photo.

    1. > Create a Project
    2. > Click on Project (In the Toolstrip) and Select Application Properties


    3. > Click on Settings



    4. >> Settings Brief Explanation



    Purple Arrow : The Purple Arrow is Pointing to the Variable name. For Example in this case it would be like typing Dim Setting. Except the Varibles Stay with in the application no matter if it closes or not.

    Orange Arrow : The Orange Arrow is Pointing to the Variable type. Such as String , Integer , Etc

    Blue Arrow : The Blue Arrow is Pointing to the Value which should match the type.

    So if we wanted to convert a normal variable into one that saves it would be like this..

    Dim Setting As String
    Setting = "" (Value Considering theres nothing there).

    Using Settings Out of Properties

    Now that you set your setting you will have to know how to use it...

    When you want a value saved as the setting you would type..

    My.Setting.Setting = "Test"
    My.Setting.Save()

    Code Examples

    1. > Saving a Textbox1's Date and Setting it to Load on Form Open.

    Code:
    Public Class Form1
        Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.FormClosing
            My.Settings.Setting = TextBox1.Text
            My.Settings.Save()
        End Sub
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            TextBox1.Text = My.Settings.Setting
        End Sub
    End Class
    2. > Saving a Checkbox's Status

    Code:
    Public Class Form1
        Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.FormClosing
            My.Settings.Setting = CheckBox1.CheckState
            My.Settings.Save()
        End Sub
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            CheckBox1.CheckState = My.Settings.Setting
        End Sub
    End Class
    Note : If you have any questions feel free to reply...if not reply anyway! lol

  2. The Following User Says Thank You to CoderNever For This Useful Post:

    Sasuke Uchiha! (01-01-2015)

  3. #2
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,404
    Reputation
    157
    Thanks
    4,004
    My Mood
    Flirty
    Very nice
    Thanks for this..

  4. #3
    Zoom's Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    Your going on my 24/7 DDoS hit list.
    Posts
    8,552
    Reputation
    127
    Thanks
    5,971
    My Mood
    Happy
    Quote Originally Posted by Coder Never View Post
    Note : All Colors In Plain Text Refers to the Last Photo.

    1. > Create a Project
    2. > Click on Project (In the Toolstrip) and Select Application Properties


    3. > Click on Settings



    4. >> Settings Brief Explanation



    Purple Arrow : The Purple Arrow is Pointing to the Variable name. For Example in this case it would be like typing Dim Setting. Except the Varibles Stay with in the application no matter if it closes or not.

    Orange Arrow : The Orange Arrow is Pointing to the Variable type. Such as String , Integer , Etc

    Blue Arrow : The Blue Arrow is Pointing to the Value which should match the type.

    So if we wanted to convert a normal variable into one that saves it would be like this..

    Dim Setting As String
    Setting = "" (Value Considering theres nothing there).

    Using Settings Out of Properties

    Now that you set your setting you will have to know how to use it...

    When you want a value saved as the setting you would type..

    My.Setting.Setting = "Test"
    My.Setting.Save()

    Code Examples

    1. > Saving a Textbox1's Date and Setting it to Load on Form Open.

    Code:
    Public Class Form1
        Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.FormClosing
            My.Settings.Setting = TextBox1.Text
            My.Settings.Save()
        End Sub
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            TextBox1.Text = My.Settings.Setting
        End Sub
    End Class
    2. > Saving a Checkbox's Status

    Code:
    Public Class Form1
        Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.FormClosing
            My.Settings.Setting = CheckBox1.CheckState
            My.Settings.Save()
        End Sub
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            CheckBox1.CheckState = My.Settings.Setting
        End Sub
    End Class
    Note : If you have any questions feel free to reply...if not reply anyway! lol
    Good and easy tutorial! Keep your good work up+++
    -Rest in peace leechers-

    Your PM box is 100% full.

  5. #4
    Calebb's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    212
    Reputation
    12
    Thanks
    75
    Lawl, Now I don't gotta explain this to anybody now. Already explained it like 5 times. -.=

  6. #5
    Zoom's Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    Your going on my 24/7 DDoS hit list.
    Posts
    8,552
    Reputation
    127
    Thanks
    5,971
    My Mood
    Happy
    Quote Originally Posted by Calebb View Post
    Lawl, Now I don't gotta explain this to anybody now. Already explained it like 5 times. -.=
    Yeah tutorials are for help people!
    -Rest in peace leechers-

    Your PM box is 100% full.

  7. #6
    Calebb's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    212
    Reputation
    12
    Thanks
    75
    Yeah gj though. Very well explained. It's noob spoon fed.

Similar Threads

  1. How to make a webbrower using Visual Basics
    By KyleForrest in forum Visual Basic Programming
    Replies: 3
    Last Post: 02-21-2009, 07:30 AM
  2. Tutorial - How to use Visual Basics 6 (vb6) for WarRock hacks
    By Oneirish in forum Visual Basic Programming
    Replies: 17
    Last Post: 05-26-2008, 07:24 AM
  3. Tutorial - How to use Visual Basics 6 (vb6) for WarRock "easy"
    By Oneirish in forum Programming Tutorials
    Replies: 2
    Last Post: 04-23-2008, 08:23 AM
  4. [Help] Atom API with Visual Basic 6.0 or .NET
    By Bull3t in forum Visual Basic Programming
    Replies: 5
    Last Post: 07-23-2006, 09:21 AM
  5. Packets & Visual Basic
    By BadBob in forum Hack Requests
    Replies: 5
    Last Post: 07-20-2006, 09:28 PM

Tags for this Thread