ラベルをグレイアウトするには
使用可能/Enabled プロパティを持つコントロールは、いいえ/False を設定するとグレイアウトされますが、ラベルには使用可能/Enabled プロパティがありません。
テキストボックスに関連付ける
テキストボックスに関連付けられたラベルの場合は、テキストボックスの使用可能/Enabled プロパティをいいえ/False を設定するとグレイアウトされます。
背景色と前景色を設定する
背景色/BackColor を有効にするには、背景スタイル/BackStyle プロパティに 普通/Normal を設定してください。
Private Property Let ラベル1_Enabled(blnEnabled As Boolean)
blnラベル1_Enabled = blnEnabled
If blnEnabled Then
ラベル1.BackColor = ColorConstants.vbWhite
ラベル1.ForeColor = ColorConstants.vbBlack
Else
ラベル1.BackColor = RGB(240, 240, 240)
ラベル1.ForeColor = SystemColorConstants.vbGrayText
End If
End Property