in form1 there is a checkbox witch when you click , it will save checked value in xml file

in splash screen its has a label1.text = "welcome "
what i want is ,when splashscreen loading up check if settings of form1.checkbox1.checked if true then
do
[splashscreen]
me.text ="your not welcome"

Private Sub SplashScreen1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If My.Settings.form1_checkbox = Form1.Checkbox1.checked Then
            Label1.Text = "your not welcome"
        Else
            Label1.Text = "welcome"
        End If
    End Sub

What is your problem?

in form1 there is a checkbox1.checked=true witch it saved in xml file so
i want in load even of splash screen . it read the checked value from form1.Checkbox1
settings if its true or not

is there a way to do it ?


i want splash screen read the checked value of form1.checkbox1 xml settings file and check if its true or not
thats all !


witch that code dose not work

If I understand right: change the type of the setting "form1_checkbox" to Boolean
change the if statement to:

Private Sub SplashScreen1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If My.Settings.form1_checkbox = False Then
            Label1.Text = "your not welcome"
        Else
            Label1.Text = "welcome"
        End If
    End Sub

Not sure how to do xml but somewhere in the code I would add a sub with something like:

Public Sub checkxml()
dim ischkboxchecked as Boolean = false
' Parse the XML to read it and set the ischkboxchecked to the result
My.settings.form1_checkbox = ischkboxchked
end sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.