##分からない事、試した事
新規作成から
Form1
1Imports System.ComponentModel 2Imports System.Globalization 3Public Class Form1 4 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load 5 6 End Sub 7 8 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click 9 10 If ListBox1.SelectedIndex = 0 Then 11 Form2.Show() 12 End If 13 End Sub 14End Class
Form2
1Imports System.ComponentModel 2Imports System.Globalization 3Public Class Form2 4 Private ReadOnly list As New Dictionary(Of String, Integer) 5 Private ReadOnly list1 As New Dictionary(Of String, Integer) 6 Private ReadOnly list2 As New Dictionary(Of String, Integer) 7 Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged 8 TextBox1.Text = ComboBox1.SelectedItem.ToString 9 10 End Sub 11 Private Sub R00_CheckedChanged(sender As Object, e As EventArgs) Handles R00.CheckedChanged 12 If R00.Checked = True Then 13 ComboBox1.DataSource = New BindingSource(list, Nothing) 14 End If 15 End Sub 16 17 Private Sub R01_CheckedChanged(sender As Object, e As EventArgs) Handles R01.CheckedChanged 18 If R01.Checked = True Then 19 ComboBox1.DataSource = New BindingSource(list1, Nothing) 20 End If 21 End Sub 22 23 Private Sub R02_CheckedChanged(sender As Object, e As EventArgs) Handles R02.CheckedChanged 24 If R02.Checked = True Then 25 ComboBox1.DataSource = New BindingSource(list2, Nothing) 26 End If 27 End Sub 28 29 Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load 30 31 list.Add("a", 0) 32 list1.Add("b", 0) 33 list2.Add("c", 0) 34 ComboBox1.DisplayMember = "key" 35 ComboBox1.ValueMember = "value" 36 ComboBox1.DataSource = New BindingSource(list, Nothing) 37 ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList 38end sub 39Private Sub Button2_Click_1(sender As Object, e As EventArgs) Handles Button2.Click 40 Form3.Show() 41 End Sub 42End Class
Form3
1Public Class Form3 2 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click 3 Me.Hide() 4 End Sub 5 6 Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click 7 If Form2.ComboBox1.SelectedIndex = 0 Then 8 PictureBox1.Image = My.Resources.A00 9 End If 10 If Form2.ComboBox1.SelectedIndex = 1 Then 11 PictureBox1.Image = My.Resources.A01 12 End If 13 End Sub 14End Class
新規で試した結果画像表示されました。
ブレークモードも確認しましたが何も問題なく、一つずつすべてのコードを確認
しました。
##バージョンなど
Vistual studio2017
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。