vb如何用点击combobox中list选项来实现后面文本框或者label里内容的变换

现在主要想知道图片的变换......
2024-12-19 08:42:01
推荐回答(3个)
回答1:

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.Items.Add("initial_picture")
ComboBox1.Items.Add("change_picture")
End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.SelectedItem = "change_picture" Then
PictureBox1.Load("需要改的照片路径,注意加上文件后缀名")
Else
PictureBox1.Load("照片路径")
End If
End Sub
End Class

回答2:

Private Sub Combo1_Change()
Text1.Text = Combo1.Text
End Sub

回答3:

Private Sub Combo1_Click()
Text1.Text = "我变化了"
End Sub