white_flag
09-03-2010, 05:33 AM
Hello
I like to know if this is possible: change font color for disable textbox. For the moment it is an gray font text + shadow (or at least to take the shadow out):
the code:
Private Sub Check()
Dim i As Integer
For i = 1 To 10
If Me.Controls("CheckBox" & i) = True Then
Me.Controls("TextBox" & i).Enabled = True
Me.Controls("TextBox" & i + 10).Enabled = True
Me.Controls("TextBox" & i + 20).Enabled = True
Me.Controls("TextBox" & i + 30).Enabled = True
Me.Controls("TextBox" & i).BackColor = &H80000005
Me.Controls("TextBox" & i).ForeColor = RGB(255, 0, 0)
Me.Controls("TextBox" & i + 10).BackColor = &H80000005
Me.Controls("TextBox" & i + 10).ForeColor = RGB(255, 0, 0)
Me.Controls("TextBox" & i + 20).BackColor = &H80000005
Me.Controls("TextBox" & i + 20).ForeColor = &H80000003
Me.Controls("TextBox" & i + 30).BackColor = &H80000005
Me.Controls("TextBox" & i + 30).ForeColor = &H80000003
Else
Me.Controls("TextBox" & i).Enabled = False
Me.Controls("TextBox" & i + 10).Enabled = False
Me.Controls("TextBox" & i + 20).Enabled = False
Me.Controls("TextBox" & i + 30).Enabled = False
Me.Controls("TextBox" & i).BackColor = &H80000003
Me.Controls("TextBox" & i).Font.ColorIndex
Me.Controls("TextBox" & i + 10).BackColor = RGB(255, 0, 0)
Me.Controls("TextBox" & i + 10).ForeColor = RGB(255, 0, 0)
Me.Controls("TextBox" & i + 20).BackColor = &H80000003
Me.Controls("TextBox" & i + 20).ForeColor = &H80000010
Me.Controls("TextBox" & i + 30).BackColor = &H80000003
Me.Controls("TextBox" & i + 20).ForeColor = &H80000010
End If
Next
End Sub
Me.Controls("TextBox" & i + 10).ForeColor = RGB(255, 0, 0) this is not working on disable ..on enable it is ok. so, What it is wrong?
I like to know if this is possible: change font color for disable textbox. For the moment it is an gray font text + shadow (or at least to take the shadow out):
the code:
Private Sub Check()
Dim i As Integer
For i = 1 To 10
If Me.Controls("CheckBox" & i) = True Then
Me.Controls("TextBox" & i).Enabled = True
Me.Controls("TextBox" & i + 10).Enabled = True
Me.Controls("TextBox" & i + 20).Enabled = True
Me.Controls("TextBox" & i + 30).Enabled = True
Me.Controls("TextBox" & i).BackColor = &H80000005
Me.Controls("TextBox" & i).ForeColor = RGB(255, 0, 0)
Me.Controls("TextBox" & i + 10).BackColor = &H80000005
Me.Controls("TextBox" & i + 10).ForeColor = RGB(255, 0, 0)
Me.Controls("TextBox" & i + 20).BackColor = &H80000005
Me.Controls("TextBox" & i + 20).ForeColor = &H80000003
Me.Controls("TextBox" & i + 30).BackColor = &H80000005
Me.Controls("TextBox" & i + 30).ForeColor = &H80000003
Else
Me.Controls("TextBox" & i).Enabled = False
Me.Controls("TextBox" & i + 10).Enabled = False
Me.Controls("TextBox" & i + 20).Enabled = False
Me.Controls("TextBox" & i + 30).Enabled = False
Me.Controls("TextBox" & i).BackColor = &H80000003
Me.Controls("TextBox" & i).Font.ColorIndex
Me.Controls("TextBox" & i + 10).BackColor = RGB(255, 0, 0)
Me.Controls("TextBox" & i + 10).ForeColor = RGB(255, 0, 0)
Me.Controls("TextBox" & i + 20).BackColor = &H80000003
Me.Controls("TextBox" & i + 20).ForeColor = &H80000010
Me.Controls("TextBox" & i + 30).BackColor = &H80000003
Me.Controls("TextBox" & i + 20).ForeColor = &H80000010
End If
Next
End Sub
Me.Controls("TextBox" & i + 10).ForeColor = RGB(255, 0, 0) this is not working on disable ..on enable it is ok. so, What it is wrong?