hmmm... I don't really know what to say. I can't seem to recreate the
problem you're having. I've run that same exact code that you have up
there (below) and I get the behavior that you want. Have you tried
opening up a dummy project and just testing that piece of code in the
new project. Do you have other text boxes that you do this to? Is it
only happening to one of them or all of them? I really don't know what
to say since I can't recreate it. I'm just trying to help possibly
guide you to find the solution.
Another thing you might want to check (doubt this is it, but worth a
check)... Did you happen to set the transparency key of your form to
black?
Here's the code I tried: I just have a form (Form2) with a textbox and
a button on it.
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.txtComponentDescription.BackColor = Me.BackColor
Me.txtComponentDescription.Enabled = False
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.txtComponentDescription.Enabled = True
Me.txtComponentDescription.BackColor = SystemColors.Info
End Sub
Private Sub txtComponentDescription_Leave(ByVal sender As Object,
ByVal e As System.EventArgs) Handles txtComponentDescription.Leave
Me.txtComponentDescription.BackColor =
System.Drawing.Color.Black
Me.txtComponentDescription.Enabled = False
End Sub
If there's possibly any other information you might have, we can work
on trying to pinpoint the issue.
Derek Woo
dbuchanan - 28 Oct 2005 21:43 GMT
Derek,
Thank you for your reply.
> Have you tried opening up a dummy project and just testing that piece of code
I'll try that.
> Do you have other text boxes that you do this to?
No.
> Did you happen to set the transparency key of your form to black?
No. And I used black only after you suggested to use more contrast.
Another thing is that this is in a derived form (visual inheritance),
I'll try it in the same project where I am not using visual inheritance
and see what I get.
dbuchanan