掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
チェックボックスの使い方をご教授下さい (ID:118149)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
チェックボックスを使ってチェックを入れると背景の色が変わり、ラベル1に入力している文字(AがBのように)変わるのを作っているのですが、 背景を変えるのとAをBにするところまではできたのですが、次にチェックをはずすと初めから入力してあるAに戻る方法が分かりません。 If文を使って地道に作っていたのですが、あまりも莫大な量になってしまうので、何か良い方法があればご教授下さい。 Private Sub Check10_Click() If Check10.Value = vbChecked Then Frame10.BackColor = &HFFC0C0 Check10.BackColor = &HFFC0C0 Label70.ForeColor = &HFF0000 If List2.ListIndex = 0 Then Label70.Caption = "0" End If If List2.ListIndex = 1 Then Label70.Caption = "1" End If If List2.ListIndex = 2 Then Label70.Caption = "2" End If If List2.ListIndex = 3 Then Label70.Caption = "3" End If こんな感じでずっーと続く… Else Frame10.BackColor = &H8080FF Check10.BackColor = &H8080FF Label70.ForeColor = &HFF If List1.ListIndex = 0 Then Label70.Caption = "0" End If If List1.ListIndex = 1 Then Label70.Caption = "A" End If If List1.ListIndex = 2 Then Label70.Caption = "B" End If If List1.ListIndex = 3 Then Label70.Caption = "C" こんな感じでずっーと続く… End If End If End Sub
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.