質問編集履歴
1
修正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
ラジオボタンを
|
1
|
+
ラジオボタンをチェック後、combobox表示を消したい。
|
body
CHANGED
@@ -1,31 +1,23 @@
|
|
1
|
-
|
1
|
+
##ソースコード
|
2
2
|
```ここに言語を入力
|
3
3
|
Imports System.Globalization
|
4
4
|
Private ReadOnly list As New Dictionary(Of String, Integer)
|
5
5
|
|
6
6
|
foam_load
|
7
|
-
If RadioButton1.Checked = True Then
|
8
|
-
RadioButton1.Checked = True
|
9
|
-
list.Add("(なし)",0)
|
7
|
+
list.Add("(なし)",0)'ラジオボタン1を押すと(なし)表示
|
10
|
-
End If
|
11
|
-
If RadioButton2.Checked = True Then
|
12
|
-
RadioButton2.Checked = False
|
13
|
-
list.Add("A",0)
|
8
|
+
list.Add("A",0)'ラジオボタン2を押すとA~F表示
|
14
9
|
list.Add("B",0)
|
15
10
|
list.Add("C"0)
|
16
11
|
list.Add("D",0)
|
17
12
|
list.Add("E",0)
|
18
13
|
list.Add("F",0)
|
19
|
-
End If
|
20
|
-
If RadioButton3.Checked = False Then
|
21
|
-
RadioButton3.Checked = True
|
22
|
-
list.Add("G",0)
|
14
|
+
list.Add("G",0)’ラジオボタン3を押すとG~L表示
|
23
15
|
list.Add("H",0)
|
24
16
|
list.Add("I"0)
|
25
17
|
list.Add("J",0)
|
26
18
|
list.Add("K",0)
|
27
19
|
list.Add("L",0)
|
28
|
-
|
20
|
+
|
29
21
|
ComboBox1.DisplayMember = "key"
|
30
22
|
ComboBox1.ValueMember = "value"
|
31
23
|
ComboBox1.DataSource = New BindingSource(list, Nothing)
|
@@ -33,13 +25,17 @@
|
|
33
25
|
TextBox1.Enabled = False
|
34
26
|
end sub
|
35
27
|
Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged
|
28
|
+
'ラジオボタン2と3のcomboboxの表示は消える
|
36
29
|
If RadioButton1.Checked = True Then
|
37
30
|
RadioButton1.Checked = True
|
38
31
|
RadioButton2.Checked = False
|
39
32
|
RadioButton3.Checked = False
|
40
33
|
ComboBox1.SelectedIndex = 0
|
41
34
|
end if
|
35
|
+
if RadioButton1.Checked = False Then
|
36
|
+
list.Clear()
|
37
|
+
end if
|
42
|
-
end sub
|
38
|
+
end sub
|
43
39
|
Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.CheckedChanged
|
44
40
|
If RadioButton2.Checked = True Then
|
45
41
|
RadioButton1.Checked = False
|
@@ -47,6 +43,9 @@
|
|
47
43
|
RadioButton3.Checked = False
|
48
44
|
ComboBox1.SelectedIndex = 1'A~
|
49
45
|
end if
|
46
|
+
if RadioButton2.Checked = False Then
|
47
|
+
list.Clear()
|
48
|
+
end if
|
50
49
|
end sub
|
51
50
|
Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton3.CheckedChanged
|
52
51
|
If RadioButton3.Checked = True Then
|
@@ -54,19 +53,22 @@
|
|
54
53
|
RadioButton2.Checked = False
|
55
54
|
ComboBox1.SelectedIndex = 7'G~
|
56
55
|
end if
|
56
|
+
if RadioButton3.Checked = False Then
|
57
|
+
list.Clear()
|
58
|
+
end if
|
57
59
|
end sub
|
58
60
|
```
|
59
61
|
コードは作成中のものです。
|
60
62
|
##わからない事
|
61
|
-
|
63
|
+
修正してみましたが解決しませんでした。
|
62
|
-
|
64
|
+
具体的には
|
63
65
|
|
64
|
-
最終的には
|
65
|
-
1を
|
66
|
+
ラジオボタン1を有効「(なし)」表示され「2,3の表示を消す」
|
66
|
-
2を押すとA~F表示され1の表示
|
67
|
+
ラジオボタン2を押すとA~F表示され「1と3の表示を消す」
|
67
|
-
3を押すとG~L表示され2の表示
|
68
|
+
ラジオボタン3を押すとG~L表示され「1,2の表示を消す」
|
68
|
-
ようにしたいのですが、教えてください。
|
69
69
|
|
70
|
+
すいません、いろいろ試しに検索したりしても解決しませんでした。
|
71
|
+
|
70
72
|
##開発バージョン
|
71
73
|
visual studio 2019
|
72
74
|
OS windows 10
|