Quantcast
Channel: OKWAVE 最新質問(Visual Basic/257)【本日】
Viewing all articles
Browse latest Browse all 6510

Visual Basicで困っています

$
0
0
Visual Basic 2010でテキストボックスとコンボボックスを複数設置し コンボボックスの選択の組み合わせによって消すテキストボックスを決めたいと思っています。 初心者で下記のようなコードしか思いつかないのですが、これを簡略化できませんか? 例) コンボボックス1で一番目の項目を選択して、コンボボックス2で一番目の項目を選択した場合は テキストボックス1のテキストを消す コンボボックス1で一番上の項目を選択して、コンボボックス2で二番目の項目を選択した場合は テキストボックス2のテキストを消す みたいな感じです。 コード If ComboBox1.SelectedIndex = 0 And ComboBox2.SelectedIndex = 1 Then TextBox1.Clear() ElseIf ComboBox1.SelectedIndex = 0 And ComboBox2.SelectedIndex = 2 Then TextBox2.Clear() ElseIf ComboBox1.SelectedIndex = 0 And ComboBox2.SelectedIndex = 3 Then TextBox3.Clear()     ElseIf ComboBox1.SelectedIndex = 0 And ComboBox2.SelectedIndex = 4 Then TextBox4.Clear() End If わかりづらい文章で申し訳ないですが、わかる方、回答をお願いします。

Viewing all articles
Browse latest Browse all 6510

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>