質問編集履歴
2
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -10,13 +10,13 @@
|
|
10
10
|
|
11
11
|
現在:
|
12
12
|
|
13
|
-
1.Combobox1にフォーカスがある状態で、Combobox2の「
|
13
|
+
1.Combobox1にフォーカスがある状態で、Combobox2の「∨」ボタン(Combobox右端の∨)をクリック。
|
14
14
|
2.一瞬項目が表示されるが、その後項目が消えてしまう。
|
15
|
-
3.再度、Combobox2の「
|
15
|
+
3.再度、Combobox2の「∨」ボタンをクリックすると、項目が表示される。
|
16
16
|
|
17
17
|
理想:
|
18
18
|
|
19
|
-
1.Combobox1にフォーカスがある状態で、Combobox2の「
|
19
|
+
1.Combobox1にフォーカスがある状態で、Combobox2の「∨」ボタンをクリック。
|
20
20
|
2.項目が表示される。
|
21
21
|
|
22
22
|
|
1
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -43,14 +43,13 @@
|
|
43
43
|
{
|
44
44
|
InitializeComponent();
|
45
45
|
|
46
|
-
comboBox1.Items.Add("0: a ");
|
46
|
+
comboBox1.Items.Add("0: a ");
|
47
|
-
comboBox1.Items.Add("1: b ");
|
47
|
+
comboBox1.Items.Add("1: b ");
|
48
|
-
comboBox1.Items.Add("2: c ");
|
48
|
+
comboBox1.Items.Add("2: c ");
|
49
49
|
|
50
|
-
comboBox2.Items.Add("0: X ");
|
50
|
+
comboBox2.Items.Add("0: X ");
|
51
|
-
comboBox2.Items.Add("1: Y ");
|
51
|
+
comboBox2.Items.Add("1: Y ");
|
52
|
-
comboBox2.Items.Add("2: Z ");
|
52
|
+
comboBox2.Items.Add("2: Z ");
|
53
|
-
|
54
53
|
}
|
55
54
|
|
56
55
|
ComboBox[] comboBoxArray = new ComboBox[2];
|
@@ -61,8 +60,6 @@
|
|
61
60
|
|
62
61
|
private void Form1_Load(object sender, EventArgs e)
|
63
62
|
{
|
64
|
-
|
65
|
-
//キーイベントをフォームで受け取る
|
66
63
|
this.KeyPreview = true;
|
67
64
|
|
68
65
|
comboBoxArray[0] = comboBox1;
|
@@ -70,7 +67,6 @@
|
|
70
67
|
|
71
68
|
for (int i = 0; i < 2; i++)
|
72
69
|
{
|
73
|
-
// テキストボックスの内容が変更された場合にイベントを発生させる
|
74
70
|
comboBoxArray[i].Enter += new EventHandler(_Enter);
|
75
71
|
}
|
76
72
|
}
|
@@ -79,24 +75,21 @@
|
|
79
75
|
{
|
80
76
|
for (int i = 0; i < comboBoxArray.Length; i++)
|
81
77
|
{
|
82
|
-
// 指定した複数の Object インスタンスが同一インスタンスかどうかを判断します
|
83
78
|
if (Object.ReferenceEquals(sender, comboBoxArray[i]))
|
84
79
|
{
|
85
|
-
// テキストボックスに配置された値を textValues[i]に代入
|
86
80
|
comboValues[i] = (comboBoxArray[i].Text);
|
87
81
|
|
88
82
|
if(i == 0)
|
89
83
|
{
|
90
|
-
comboBox1.DroppedDown = true;
|
84
|
+
comboBox1.DroppedDown = true;
|
91
85
|
}
|
92
86
|
|
93
87
|
if (i == 1)
|
94
88
|
{
|
95
|
-
comboBox2.DroppedDown = true;
|
89
|
+
comboBox2.DroppedDown = true;
|
96
90
|
}
|
97
91
|
}
|
98
92
|
}
|
99
|
-
|
100
93
|
}
|
101
94
|
|
102
95
|
private void Form1_KeyDown(object sender, KeyEventArgs e)
|
@@ -107,8 +100,8 @@
|
|
107
100
|
{
|
108
101
|
this.SelectNextControl(this.ActiveControl, true, true, true, true);
|
109
102
|
}
|
110
|
-
|
103
|
+
}
|
111
|
-
|
104
|
+
}
|
112
105
|
}
|
113
106
|
}
|
114
107
|
|