Good Day,

I would like to ask some Help regarding on Changing Wallpaper of a Form Using a Dropdown List,

and if possible that it have NO Button to change when the user Choose a list it instantly Change the Wallpaper of that Certain Form.

Your Response is Highly Appreciated,

Thank you.
Eos

Recommended Answers

All 5 Replies

Yes it is possible, just check if the value of your drop down list has changed.

If yes, then change the background image of your form.

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

    If ComboBox1.SelectedItem.ToString = "Sample1" Then

        PictureBox1.Visible = False

    End If
    If ComboBox1.SelectedItem.ToString = "Sample2" Then

        PictureBox2.Visible = False

    End If
End Sub

Thats my code, But the problem is The Image disappear.

Thank you for Your Response.

Eos

Try doing this, hope this helps

       If ComboBox1.SelectedItem.ToString = "Sample1" Then
            PictureBox1.Visible = True
            PictureBox2.Visible = False
        End If
        If ComboBox1.SelectedItem.ToString = "Sample2" Then
            PictureBox1.Visible = False
            PictureBox2.Visible = True
        End If

Good Day,

That one is working,

But what if i dont like the Picture box to use, is it posible to use the Wallpaper of the Form change into different Picture via Dropdown Box?

Is it Posible

Thank you.

Yeah, you can use this:

If ComboBox1.SelectedItem.ToString = "sample 1" Then

      Me.BackgroundImage = System.Drawing.Image.FromFile("path here")

elseIf ComboBox1.SelectedItem.ToString = "sample 2" Then

      Me.BackgroundImage = System.Drawing.Image.FromFile("path here")

End If
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.