Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If ComboBox1.SelectedText = "Anaheim" Then Dim finalpath As String = "C:\hockey055f\data\model\ice0.png"
My.Resources.anaice.Save("C:\hockey055f\data\model\ice0.png")
MsgBox("Installed!", MsgBoxStyle.Information, "Installed by GoLeafsGo")
ElseIf ComboBox1.SelectedText = "Boston" Then If System.IO.File.Exists("c:\hockey055f\data\model\ice0.png") Then
System.IO.File.Delete("c:\hockey055f\data\model\ice0.png")
My.Resources.bosice.Save("C:\hockey055f\data\model\ice0.png")
MsgBox("Installed!", MsgBoxStyle.Information, "Installed by GoLeafsGo")
End Sub
这是我的代码。我正在尝试这样做,以便当用户在组合框中选择一个项目并且用户按下按钮时,该文件将从我的资源传输到上面显示的目录。当我单击第一个值(阿纳海姆)时,文件“anaice.png”被传输,但随后(波士顿)值中的“bosice.png”被放入并覆盖另一个图像。请帮忙!