Visual basic code for background image of an app

5 pts.
Tags:
Visual Basic
I want to create a code where if i put If TextBox2.Text = "change background image" Then Me.BackgroundImage = System.Drawing.Image.FromFile("C:Users... enter your image file"). However I want like a open file dialog where it shows the different images to choose from to change the background image of the app One person told me this
Using ofd As New OpenFileDialog
With ofd
.Filter = "Images|*.bmp;*.jpg;*.jpeg;*.png"
.Multiselect = False
.Title = "Select Image"
End With

If ofd.ShowDialog = DialogResult.OK Then
TextBox2.Text = ofd.FileName
End If
End Using
However it gives me errors saying using must end with end using which i both put but please help me please be specific Below is a link to a picture of the code with the issue https://www.dropbox.com/s/dlwye3ne6am58hj/image.jpeg?dl=0


Software/Hardware used:
Visual Basic
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: