質問編集履歴

4

文字の追加

2019/02/21 15:03

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -242,6 +242,10 @@
242
242
 
243
243
  解決?しました。
244
244
 
245
+ 変更後
246
+
247
+ textbox1が値段、textbox2を文字を入力(検索)にしました。
248
+
245
249
  ###わからない事、教えてほしいこと
246
250
 
247
251
  **文字を入力後、comboboxのアイテムが消える**

3

文字の修正と書き直し

2019/02/21 15:03

投稿

退会済みユーザー
test CHANGED
@@ -1 +1 @@
1
- テキストボックスに文字を検索させたい
1
+ テキストボックスに文字を検索とselectindexを変更したい
test CHANGED
@@ -1,52 +1,166 @@
1
- ###前提・したいこと
1
+ ###実践、やりたい事と変更したい場所
2
-
2
+
3
- 変更前のコード
3
+ **変更前のコード**
4
4
 
5
5
  ```ここに言語を入力
6
6
 
7
+ Imports System.Globalization
8
+
9
+
10
+
11
+ Public Class Form1
12
+
13
+ Private list As New List(Of String)()
14
+
15
+ Private Sub Kaou_Load(sender As Object, e As EventArgs) Handles MyBase.Load
16
+
17
+ list.Add("あり")
18
+
19
+ list.Add("ありんこ")
20
+
21
+ list.Add("いぬ")
22
+
23
+ list.Add("いのしし")
24
+
25
+ list.Add("うさぎ")
26
+
27
+ end sub
28
+
7
29
  Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
8
30
 
9
31
  If ComboBox1.SelectedIndex = 0 Then
10
32
 
11
- TextBox3.Text = "1"
33
+ TextBox2.Text = "10"
12
-
34
+
13
- End If
35
+ End If
36
+
37
+ If ComboBox1.SelectedIndex = 1 Then
38
+
39
+ TextBox2.Text = "10"
40
+
41
+ End If
42
+
43
+ If ComboBox1.SelectedIndex = 2 Then
44
+
45
+ end if
46
+
47
+ If ComboBox1.SelectedIndex = 3 Then
48
+
49
+ TextBox2.Text = "100000"
50
+
51
+ End If
52
+
53
+ If ComboBox1.SelectedIndex = 4 Then
54
+
55
+ TextBox2.Text = "150000"
56
+
57
+ End If
58
+
59
+ end sub
60
+
61
+ '値段は例です全部で5個あります
62
+
63
+ Private Sub TextBox3_TextChanged(sender As Object, e As EventArgs) Handles TextBox3.TextChanged
64
+
65
+ 'テキストを書き換えるたびに、
66
+
67
+ 'リストの内容を先頭一致でフィルタリング
68
+
69
+ Dim ci = New CultureInfo("ja-jp").CompareInfo
70
+
71
+ Dim opt As CompareOptions
72
+
73
+ opt = opt Or CompareOptions.IgnoreWidth '全角と半角を区別しない
74
+
75
+ opt = opt Or CompareOptions.IgnoreKanaType 'ひらがなとカタカナを区別しない
76
+
77
+ opt = opt Or CompareOptions.IgnoreCase '大文字と小文字を区別しない
78
+
79
+ opt = opt Or CompareOptions.IgnoreNonSpace '文字列比較で分音文字などの結合の分音文字を無視することを示します。
80
+
81
+ opt = opt Or CompareOptions.IgnoreSymbols '文字列の比較が空白文字が区切り記号、通貨記号、パーセント記号、数学記号、アンパサンド、やなどの記号を無視することを示します。
82
+
83
+
84
+
85
+ Dim txt As String = TextBox3.Text
86
+
87
+
88
+
89
+ ComboBox1.DataSource = list.Where(
90
+
91
+ Function(s)
92
+
93
+ Return 0 = ci.Compare(Strings.Left(s, txt.Length), txt, opt)
94
+
95
+ End Function).ToArray()
96
+
97
+ End Sub
98
+
99
+ End Class
100
+
101
+
14
102
 
15
103
  ```
16
104
 
105
+ **変更前のコードは全体のコードです。**
106
+
107
+ ・「変更前」で実践
108
+
109
+ textbox2=値段、textbox3=文字入力するとその文字が表示される
110
+
111
+ あ=あり、ありんこ(カタカナでも可能)
112
+
113
+ い=いぬ、いのしし
114
+
115
+ う=うさぎ・・・など他の文字は表示されません。
116
+
117
+
118
+
119
+ ---
120
+
121
+ ・indexとtextbox2これでやってます。
122
+
123
+ この場合新しいアイテム追加(間に入れるときも)して書き出し
124
+
125
+ 追加前
126
+
127
+ index="1"Then’ありんこ
128
+
129
+ textbox2.text=""
130
+
131
+ 追加後
132
+
17
- 50個分のアイテムをlist.Add("")間に入れたのをindexとtextbox3
133
+ index="2"Then'ありんこ
134
+
18
-
135
+ textbox2.text=""
136
+
137
+ こんな感じで何個があります。
138
+
19
- これを書き直しすることにので破棄しました。
139
+ これを書き直しなど大変なのでindexとtextbox破棄しました。
20
-
21
-
22
-
23
-
24
-
25
- ・コンボボックスアイテムをテキストボックスに入力するだけで
140
+
26
-
27
- 文字を検索できるようにしたい事。
141
+
28
-
29
- ・textbox2に「あ」がつく文字をいれると
142
+
30
-
31
- combobox1にあが付く文字だけ表示させたい事。
32
-
33
-
34
-
35
- ンボボックス
143
+ 変更後のード
144
+
145
+
146
+
36
-
147
+ ```ここに言語を入力
148
+
37
- ```Imports System.Globalization
149
+ Imports System.Globalization
38
-
150
+
39
- Public Class Sentakusenzai
151
+ Public Class Form1
40
152
 
41
153
  Private list As New Dictionary(Of String, Integer)
42
154
 
43
155
 
44
156
 
45
- Private Sub Sentakusenzai_Load(sender As Object, e As EventArgs) Handles MyBase.Load
157
+ Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
158
+
46
-
159
+      ’変更前の list.Add("あり")
160
+
161
+
162
+
47
- 'アイテム
163
+ '変更後のアイテム
48
-
49
-     
50
164
 
51
165
  list.Add("あり", 1)
52
166
 
@@ -66,204 +180,92 @@
66
180
 
67
181
  ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
68
182
 
69
-
183
+ End Sub
184
+
185
+ Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
186
+
187
+ TextBox1.Text = ComboBox1.SelectedValue.ToString
70
188
 
71
189
  End Sub
72
190
 
73
-
191
+ Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
192
+
193
+ Dim cca = New CultureInfo("ja-jp").CompareInfo
194
+
195
+ Dim opt As CompareOptions
196
+
197
+ opt = opt Or CompareOptions.IgnoreWidth '全角と半角を区別しない
198
+
199
+ opt = opt Or CompareOptions.IgnoreKanaType 'ひらがなとカタカナを区別しない
200
+
201
+ opt = opt Or CompareOptions.IgnoreCase '大文字と小文字を区別しない
202
+
203
+ opt = opt Or CompareOptions.IgnoreNonSpace '文字列比較で分音文字などの結合の分音文字を無視することを示します。
204
+
205
+ opt = opt Or CompareOptions.IgnoreSymbols '文字列の比較が空白文字が区切り記号、通貨記号、パーセント記号、数学記号、アンパサンド、やなどの記号を無視することを示します。
206
+
207
+
208
+
209
+ Dim txt As String = TextBox2.Text
210
+
211
+
212
+
213
+ ComboBox1.DataSource = New BindingSource(list.Where(
214
+
215
+ Function(s)
216
+
217
+ Return 0 = cca.Compare(Strings.Left(s.Key, txt.Length), txt, opt)
218
+
219
+ End Function).ToArray(), Nothing)
220
+
221
+ End Sub
222
+
223
+
224
+
225
+ End Class
74
226
 
75
227
  ```
76
228
 
229
+ 全体でのコードです。
230
+
231
+ ###変更後のやりたい事と修正したい
232
+
233
+ **変更後のコードで文字をいれても変わりません**
234
+
77
- **文字を検索**
235
+ **値段の方は
78
-
79
- ``` Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
236
+
80
-
81
- Dim cca = New CultureInfo("ja-jp").CompareInfo
82
-
83
- Dim opt As CompareOptions
237
+ ```ここに言語を入力
84
-
85
- opt = opt Or CompareOptions.IgnoreWidth '全角と半角を区別しない
238
+
86
-
87
- opt = opt Or CompareOptions.IgnoreKanaType 'ひらがなとカタカナを区別しない
88
-
89
- opt = opt Or CompareOptions.IgnoreCase '大文字と小文字を区別しない
90
-
91
- opt = opt Or CompareOptions.IgnoreNonSpace '文字列比較で分音文字などの結合の分音文字を無視することを示します。
92
-
93
- opt = opt Or CompareOptions.IgnoreSymbols '文字列の比較が空白文字が区切り記号、通貨記号、パーセント記号、数学記号、アンパサンド、やなどの記号を無視することを示します。
94
-
95
-
96
-
97
- Dim txt As String = TextBox2.Text
98
-
99
-
100
-
101
- ComboBox1.DataSource = New BindingSource(list.Where(
239
+ TextBox1.Text = ComboBox1.SelectedValue.ToString
102
-
103
- Function(s)
104
-
105
- Return 0 = cca.Compare(Strings.Left(s.Value, txt.Length), txt, opt)
106
-
107
- End Function).ToArray(), Nothing)
108
-
109
- End Sub
110
-
111
-
112
240
 
113
241
  ```
114
242
 
115
- **値段**
116
-
117
- ```こに言語を入力
118
-
119
- Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
120
-
121
- Dim de As New DictionaryEntry
122
-
123
- Dim cb1 As New Integer
124
-
125
- de = CType(ComboBox1.SelectedItem, DictionaryEntry)
126
-
127
- cb1 = de.Value
128
-
129
- TextBox1.Text = (cb1).ToString()
130
-
131
- End Sub
132
-
133
- ```
134
-
135
- ###試したこと、やりたい事
136
-
137
- 回答させていただいた通行った結果は
138
-
139
- ###エラー
140
-
141
- ```ここに言語を入力
142
-
143
- de = CType(ComboBox1.SelectedItem, DictionaryEntry)
144
-
145
- 指定されたキャストは有効ではありません。'
146
-
147
-
148
-
149
- ```
150
-
151
- 値段を表示するんですがエラーが出てしまいました。
152
-
153
- 回避することは可能でしょうか?
154
-
155
- ・「文字を入力」したらCombobox1でなぜが「あ」が付いた文字が表示されず
156
-
157
- 他の文字も表示されてしまいました。
158
-
159
- 変更前のコード
160
-
161
- ```ここに言語を入力
162
-
163
- Private list As New List(Of String)()
164
-
165
- foam1
166
-
167
-
168
-
169
- Private Sub TextBox3_TextChanged(sender As Object, e As EventArgs) Handles TextBox3.TextChanged
170
-
171
- 'テキストを書き換えるたびに、
172
-
173
- 'リストの内容を先頭一致でフィルタリング
174
-
175
- Dim ci = New CultureInfo("ja-jp").CompareInfo
176
-
177
- Dim opt As CompareOptions
178
-
179
- opt = opt Or CompareOptions.IgnoreWidth '全角と半角を区別しない
180
-
181
- opt = opt Or CompareOptions.IgnoreKanaType 'ひらがなとカタカナを区別しない
182
-
183
- opt = opt Or CompareOptions.IgnoreCase '大文字と小文字を区別しない
184
-
185
- opt = opt Or CompareOptions.IgnoreNonSpace '文字列比較で分音文字などの結合の分音文字を無視することを示します。
186
-
187
- opt = opt Or CompareOptions.IgnoreSymbols '文字列の比較が空白文字が区切り記号、通貨記号、パーセント記号、数学記号、アンパサンド、やなどの記号を無視することを示します。
188
-
189
-
190
-
191
- Dim txt As String = TextBox3.Text
192
-
193
-
194
-
195
- ComboBox1.DataSource = list.Where(
196
-
197
- Function(s)
198
-
199
- Return 0 = ci.Compare(Strings.Left(s, txt.Length), txt, opt)
200
-
201
- End Function).ToArray()
202
-
203
- End Sub
204
-
205
- ```
206
-
207
- この場合はちゃんとあだけの文字をいれたらcomboboxであが付く文字が表示される
208
-
209
- 変更後の場合は
210
-
211
- ```ここに言語を入力
212
-
213
- ComboBox1.DataSource = New BindingSource(list.Where(
214
-
215
- Function(s)
216
-
217
- Return 0 = cca.Compare(Strings.Left(s.Key, txt.Length), txt, opt)
218
-
219
- End Function).ToArray(), Nothing)
220
-
221
- End Sub
222
-
223
- ```
224
-
225
- 変更前
226
-
227
- ```ここに言語を入力
228
-
229
- Dim txt As String = TextBox3.Text
230
-
231
-
232
-
233
- ComboBox1.DataSource = list.Where(
234
-
235
- Function(s)
236
-
237
- Return 0 = ci.Compare(Strings.Left(s, txt.Length), txt, opt)
238
-
239
- End Function).ToArray()
240
-
241
- End Sub
242
-
243
- ```
244
-
245
- s,とs.でしょうか?
246
-
247
-
248
-
249
- 文字を入力後comboboxの表示があが付く文字に変わるようにしたい
250
-
251
- エラーを回避させたい
252
-
253
- 修正しました。
254
-
255
- よろしくお願いいたします。
256
-
257
-
258
-
259
- 初心者ですので教えてください。
260
-
261
-
262
-
263
- ###バージョンなど
264
-
265
- **Windows10**
266
-
267
- **Vistual Basic(VB.net)**
268
-
269
- **Vistual Studio 2019を使ってます。**
243
+ 解決?しました。
244
+
245
+ ###わからない事、教えてほしい
246
+
247
+ **文字を入力後、comboboxのアイテムが消える**
248
+
249
+ 「あ」を入れてもあり、ありんこのみ表示しない
250
+
251
+ **変更前はあをいれるとあり、ありんことほかの文字は出ません。**
252
+
253
+ このように実行させたいのですがご迷惑をおかけしすいません。
254
+
255
+ ・文字を入力後の改善修正を教えてもらえますでしょうか?
256
+
257
+ 申し訳ございません。変更前と変更後の書き直ししました。
258
+
259
+ いろいろと試しにコード変えてみましたが4,5時間やってもできませんでした。
260
+
261
+
262
+
263
+ 初心者ですがよろくお願いいします。
264
+
265
+ ###バージョン
266
+
267
+ Windows10
268
+
269
+ Vistual basic
270
+
271
+ Vistual studio2019を使ってます。

2

説明文と内容を変更しました。

2019/02/21 15:01

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1,48 +1,178 @@
1
- ###前提・実現したいこと**
1
+ ###前提・実現したいこと
2
+
3
+ ・変更前のコード
4
+
5
+ ```ここに言語を入力
6
+
7
+ Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
8
+
9
+ If ComboBox1.SelectedIndex = 0 Then
10
+
11
+ TextBox3.Text = "1"
12
+
13
+ End If
14
+
15
+ ```
16
+
17
+ 50個分のアイテムをlist.Add("")間に入れたのをindexとtextbox3
18
+
19
+ これを書き直しすることになるので破棄しました。
20
+
21
+
22
+
23
+
2
24
 
3
25
  ・コンボボックスアイテムをテキストボックスに入力するだけで
4
26
 
5
27
  文字を検索できるようにしたい事。
6
28
 
7
- テキストボックスにあという文字をいれるとコンボボックスのアイテムが
8
-
9
- **「」の文字だけ表示させたい事です**
10
-
11
-
12
-
13
- ```
14
-
15
- Imports System.Globalization
16
-
17
- Form1
18
-
19
- Private list As New List(Of String)()
20
-
21
- foam_load
22
-
23
- list.add("あり")
24
-
25
- list.add("ありんこ")
26
-
27
- list.add("いぬ")
28
-
29
- list.add("いぬねこ")
30
-
31
- end sub
32
-
33
- Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
34
-
35
- If ComboBox1.SelectedIndex = 0 Then
36
-
37
- TextBox2.Text = "1"
38
-
39
- End If
40
-
41
- '省略
29
+ textbox2」がつく文字をいれると
30
+
31
+ combobox1にが付く文字だけ表示させたい事。
32
+
33
+
34
+
35
+ コンボボックス
36
+
37
+ ```Imports System.Globalization
38
+
39
+ Public Class Sentakusenzai
40
+
41
+ Private list As New Dictionary(Of String, Integer)
42
+
43
+
44
+
45
+ Private Sub Sentakusenzai_Load(sender As Object, e As EventArgs) Handles MyBase.Load
46
+
47
+ 'アイテム
48
+
49
+     
50
+
51
+ list.Add("あり", 1)
52
+
53
+ list.Add("ありんこ", 2)
54
+
55
+ list.Add("いぬ", 1)
56
+
57
+ list.Add("いぬねこ", 2)
58
+
59
+
60
+
61
+ ComboBox1.DisplayMember = "key"
62
+
63
+ ComboBox1.ValueMember = "value"
64
+
65
+ ComboBox1.DataSource = New BindingSource(list, Nothing)
66
+
67
+ ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
68
+
69
+
70
+
71
+ End Sub
72
+
73
+
74
+
75
+ ```
76
+
77
+ **文字を検索**
78
+
79
+ ``` Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
80
+
81
+ Dim cca = New CultureInfo("ja-jp").CompareInfo
82
+
83
+ Dim opt As CompareOptions
84
+
85
+ opt = opt Or CompareOptions.IgnoreWidth '全角と半角を区別しない
86
+
87
+ opt = opt Or CompareOptions.IgnoreKanaType 'ひらがなとカタカナを区別しない
88
+
89
+ opt = opt Or CompareOptions.IgnoreCase '大文字と小文字を区別しない
90
+
91
+ opt = opt Or CompareOptions.IgnoreNonSpace '文字列比較で分音文字などの結合の分音文字を無視することを示します。
92
+
93
+ opt = opt Or CompareOptions.IgnoreSymbols '文字列の比較が空白文字が区切り記号、通貨記号、パーセント記号、数学記号、アンパサンド、やなどの記号を無視することを示します。
94
+
95
+
96
+
97
+ Dim txt As String = TextBox2.Text
98
+
99
+
100
+
101
+ ComboBox1.DataSource = New BindingSource(list.Where(
102
+
103
+ Function(s)
104
+
105
+ Return 0 = cca.Compare(Strings.Left(s.Value, txt.Length), txt, opt)
106
+
107
+ End Function).ToArray(), Nothing)
108
+
109
+ End Sub
110
+
111
+
112
+
113
+ ```
114
+
115
+ **値段**
116
+
117
+ ```ここに言語を入力
118
+
119
+ Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
120
+
121
+ Dim de As New DictionaryEntry
122
+
123
+ Dim cb1 As New Integer
124
+
125
+ de = CType(ComboBox1.SelectedItem, DictionaryEntry)
126
+
127
+ cb1 = de.Value
128
+
129
+ TextBox1.Text = (cb1).ToString()
130
+
131
+ End Sub
132
+
133
+ ```
134
+
135
+ ###試したこと、やりたい事
136
+
137
+ 回答させていただいた通行った結果は
138
+
139
+ ###エラー
140
+
141
+ ```ここに言語を入力
142
+
143
+ de = CType(ComboBox1.SelectedItem, DictionaryEntry)
144
+
145
+ 指定されたキャストは有効ではありません。'
146
+
147
+
148
+
149
+ ```
150
+
151
+ 値段を表示するんですがエラーが出てしまいました。
152
+
153
+ 回避することは可能でしょうか?
154
+
155
+ ・「文字を入力」したらCombobox1でなぜが「あ」が付いた文字が表示されず
156
+
157
+ 他の文字も表示されてしまいました。
158
+
159
+ 変更前のコード
160
+
161
+ ```ここに言語を入力
162
+
163
+ Private list As New List(Of String)()
164
+
165
+ foam1
166
+
167
+
42
168
 
43
169
  Private Sub TextBox3_TextChanged(sender As Object, e As EventArgs) Handles TextBox3.TextChanged
44
170
 
171
+ 'テキストを書き換えるたびに、
172
+
173
+ 'リストの内容を先頭一致でフィルタリング
174
+
45
- Dim cca = New CultureInfo("ja-jp").CompareInfo
175
+ Dim ci = New CultureInfo("ja-jp").CompareInfo
46
176
 
47
177
  Dim opt As CompareOptions
48
178
 
@@ -66,7 +196,7 @@
66
196
 
67
197
  Function(s)
68
198
 
69
- Return 0 = cca.Compare(Strings.Left(s, txt.Length), txt, opt)
199
+ Return 0 = ci.Compare(Strings.Left(s, txt.Length), txt, opt)
70
200
 
71
201
  End Function).ToArray()
72
202
 
@@ -74,105 +204,55 @@
74
204
 
75
205
  ```
76
206
 
77
- ###試したこと
78
-
79
- 文字を入力すると出来ます。だ、こではコンボボックスに新たに追加した場合
207
+ この場合はちゃんとあだけの文字をいれらcomboboxであが付く文字が表示さ
80
-
81
- コンボボックスselectindex="0"~これも書き直しすることになってしまいます。
208
+
82
-
83
- [DictionaryEntry](https://jehupc.exblog.jp/9812996/)
84
-
85
- ###改(ソースコードを変した)変更
209
+ 変更後の場合は
86
-
210
+
87
- ```ここに言語を入力
211
+ ```ここに言語を入力
88
-
89
- Imports System.Globalization
212
+
90
-
91
- 'アイテム
92
-
93
- With ComboBox1
94
-
95
- .Items.Add(New DictionaryEntry("ありんこ", 1))
96
-
97
- .Items.Add(New DictionaryEntry("あり", 2))
213
+ ComboBox1.DataSource = New BindingSource(list.Where(
98
-
99
- .Items.Add(New DictionaryEntry("いぬ", 1))
214
+
100
-
101
- .Items.Add(New DictionaryEntry("いぬねこ", 2))
102
-
103
- .DisplayMember = "key"
104
-
105
- .ValueMember = "value"
106
-
107
- End With
215
+ Function(s)
108
-
109
-
110
-
111
- Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
216
+
112
-
113
- Dim den As New DictionaryEntry
114
-
115
- Dim cbd As New Integer
116
-
117
- den = CType(ComboBox1.SelectedItem, DictionaryEntry)
217
+ Return 0 = cca.Compare(Strings.Left(s.Key, txt.Length), txt, opt)
118
-
119
- cbd = de.Value
218
+
120
-
121
- TextBox1.Text = (cbd).ToString()
219
+ End Function).ToArray(), Nothing)
122
-
220
+
123
- End Sub
221
+ End Sub
124
-
125
- Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs) Handles TextBox2.TextChanged
222
+
126
-
127
- 'テキストボックス3と同じ
128
-
129
- ```
223
+ ```
130
-
131
- ###試したこと・やりたいこと
224
+
132
-
133
- 変更前のコードはそのアイテム追加後selectindex="*"then
134
-
135
- *はselectindexを破棄して変更後add("あり",1)に改変して
136
-
137
- textbox1に選択されたら「1」と表示されます。
138
-
139
- textbox2は文字を入力するとコンボボックスに
140
-
141
- あが付く文字だけを表示(変更前)させたいんですが
225
+ 変更前
142
-
226
+
143
- ```ここに言語を入力
227
+ ```ここに言語を入力
228
+
144
-
229
+ Dim txt As String = TextBox3.Text
230
+
231
+
232
+
145
- ComboBox1.DataSource = New BindingSource(list, Nothing)
233
+ ComboBox1.DataSource = list.Where(
146
-
147
- list.Where(
148
234
 
149
235
  Function(s)
150
236
 
151
237
  Return 0 = ci.Compare(Strings.Left(s, txt.Length), txt, opt)
152
238
 
153
- End Function).ToString()
239
+ End Function).ToArray()
154
-
240
+
155
- End Sub
241
+ End Sub
156
-
242
+
157
- ```
243
+ ```
158
-
244
+
159
- 教えていただいた通コードを追加てみたところ
245
+ s,とs.でょうか?
160
-
246
+
247
+
248
+
161
- 文字を入力とコンボボックスアイテムが空白(消えました
249
+ 文字を入力後comboboxの表示があが付く文字に変わようにした
162
-
250
+
163
- 後foam‗roadに
251
+ エラーを回避させたい
164
-
165
- ```
252
+
166
-
167
- ComboBox1.DataSource = New BindingSource(list, Nothing)
168
-
169
-
170
-
171
- ```
172
-
173
- そしたらコンボボックスが何も入っていない状態でした。
174
-
175
- すいせん
253
+ 修正しした
254
+
255
+ よろしくお願いいたします。
176
256
 
177
257
 
178
258
 

1

文字の修正

2019/02/21 08:14

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -130,25 +130,53 @@
130
130
 
131
131
  ###試したこと・やりたいこと
132
132
 
133
- 変更前のコードはそのアイテム追加後selectindex="*"
133
+ 変更前のコードはそのアイテム追加後selectindex="*"then
134
134
 
135
- *は追加して番号を書き換えする(数字を入れ直
135
+ *はselectindexを破棄して変更後add("あり",1)に改変
136
136
 
137
+ textbox1に選択されたら「1」と表示されます。
138
+
139
+ textbox2は文字を入力するとコンボボックスに
140
+
141
+ あが付く文字だけを表示(変更前)させたいんですが
142
+
143
+ ```ここに言語を入力
144
+
145
+ ComboBox1.DataSource = New BindingSource(list, Nothing)
146
+
147
+ list.Where(
148
+
149
+ Function(s)
150
+
151
+ Return 0 = ci.Compare(Strings.Left(s, txt.Length), txt, opt)
152
+
153
+ End Function).ToString()
154
+
155
+ End Sub
156
+
157
+ ```
158
+
159
+ 教えていただいた通コードを追加してみたところ
160
+
137
- とても大変になってしいまてこれを改善(変更
161
+ 文字を入力するとコンボボックスアイテム空白(消えまし
162
+
163
+ 後foam‗roadに
164
+
165
+ ```
166
+
167
+ ComboBox1.DataSource = New BindingSource(list, Nothing)
138
168
 
139
169
 
140
170
 
141
- 変更後のコードで文字を検索入れると
171
+ ```
142
172
 
143
- コンボボックス消えしました。
173
+ そしたらコンボボックスが何も入っていない状態でした。
144
174
 
145
- 検索入力した「あ」を入れるとあだけ表示さたいです(変更前は出来ます。)
175
+ すいません。
146
176
 
147
177
 
148
178
 
149
- 初心者ですのでコード分かりにくいかもしれませんが
150
-
151
- 教えてください。
179
+ 初心者ですので教えてください。
152
180
 
153
181
 
154
182