Results 1 to 3 of 3

Thread: [SOLVED] Saving (should be easy)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2010
    Posts
    26

    Resolved [SOLVED] Saving (should be easy)

    So, this should be easy, but since I'm not an expert in visual basic, I don't know it, so this is the problem;

    Code:
            If Not My.Settings.site1 = TextBox2.Text Then
                If MsgBox("Save websites?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
                    My.Settings.site1 = TextBox2.Text
                    My.Settings.site2 = TextBox3.Text
                    My.Settings.site3 = TextBox4.Text
                    My.Settings.site4 = TextBox5.Text
                    My.Settings.site5 = TextBox6.Text
                    My.Settings.site6 = TextBox7.Text
                    My.Settings.site7 = TextBox8.Text
                    My.Settings.site8 = TextBox9.Text
                    My.Settings.site9 = TextBox10.Text
                    My.Settings.site10 = TextBox11.Text
                    My.Settings.Save()
                    e.Cancel = False
                ElseIf MsgBoxResult.No Then
                    e.Cancel = True
                    Me.Dispose()
                End If
            End If
    So it only checks if textbox1 is changed but I want it to check for them all, how can I do this? I've tried a couple of ways but they all give me errors.

    Jordy
    Last edited by Imperoto; Jul 18th, 2010 at 05:41 AM.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Saving (should be easy)

    you'd just include them all in your if statement. here's an example that checks the first 2 settings:

    vb Code:
    1. If Not My.Settings.site1 = TextBox2.Text orelse Not My.Settings.site2 = TextBox3.Text Then

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2010
    Posts
    26

    Re: Saving (should be easy)

    I was looking for a function like that, I tried 'Or' but that didn't work heheh

    Thanks, Paul
    +Rep

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