title: set vb forms's background image dynamically
body: <p>I am trying to set a background image of a form dynamically (on the button's click event).<br>
  When I stop the deployment of an application and restart to deploy it, background image of a form is removed.<br>
  I know the background image will remains the same till the application is not stopped.<br>
  But, I want to set it permanently, like we set using resources or we set using background image property of the form or any other control.</p>
  
  <p>Code:  </p>
  
  <pre><code>Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
      If vbOK = FolderBrowserDialog2.ShowDialog() Then
          TextBox1.Text = FolderBrowserDialog2.SelectedPath
      End If
  End Sub
  
  
  Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
      Dim id As String = "bg"
      Dim folder As String = TextBox1.Text
      If TextBox1.Text = "" Then
          MsgBox("Please Select Image Path.", MsgBoxStyle.Information, "Message")
      Else
          Dim filename As String = System.IO.Path.Combine(folder, id &amp; ".jpg")
          Form1.BackgroundImage = Image.FromFile(filename)
      End If
  End Sub
  </code></pre>
  
  <p>And please note that the "bg" is the name of an image.<br>
  I know this code is the bad, and I am trying to improve it.<br>
  But, here my aim is to set a background image dynamically.<br>
  How to do it?</p>