2015-03-13 63 views
0
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged 
    If ComboBox1.SelectedValue IsNot Nothing Then 
     PictureBox1.Image = Image.FromFile("C:\Users\goodisam000\Desktop\Goodin Coding\Stuff\Pokemon Sprites\X and Y\xyani\" & (ComboBox1.SelectedItem.ToString.ToLower) & ".gif") 
    End If 
End Sub 

我想要圖片框根據所選組合框選項更改圖像。所以說,我選擇組合框中的Abra,然後我想要選擇Abra時,表單將Abra的圖像加載到圖片框中。基於組合框調整圖片框

+0

正確標記您的問題。這是VB.NET或VBA。你應該知道兩者之間的區別。 – 2015-03-13 13:51:01

+0

不是。再猜。 – 2015-03-13 13:52:56

+0

@ Dan-o再次對不起vb.net – 2015-03-13 13:54:27

回答

0

如何將圖像添加到資源中,然後從資源位置進行鏈接?

然後你就可以有形象,而不是 「資源\\ imageblabla」 「C:\用戶\ goodisam000 \桌面\古丁噴碼\東西\口袋妖怪精靈\ X和Y \ xyani \」

  • 你可以試試嗎?
+0

它沒有工作:( – 2015-03-13 14:25:13