Controls - background colour

  • Thread starter Thread starter Al@n
  • Start date Start date
A

Al@n

I hope I'm in the right group for this question.

I'm new to VB.net and am trying to change the background color of a button
when it is "clicked."

I'm using the code

"ctl..BackColor = System.Drawing.Color.Teal"

in the form_load event and it works, however when using the code with a
different color in the ctl_click event of the relevent button, in putting it
in an "If - then" statement, I'm being told that The operator'=' is not
defined.

I've some experience of VBA, however canot work this one out and would be
grateful for any assistance

Thanks

@l@n
 
I take it your doing

If ctl.BackColor = Color.Teal Then........

Color does not support the = operator.. check out Color.Op_Equality.. I
think..

not sure if this is the best or most efficient.. but it works..

HTH
 
HTH

Thanks for your assistance. I think I'm on the right track
now. If you have a more efficient way of doing this, I'd
be graeful for any input.

Al@n
 
ur welcome..

I'm not saying this IS inefficient.. just not sure if there's a more
efficient way of doing it. if there is I haven't come across it yet.

I'm fairly new to .NET myself.. so if anyone else has any input???

HTH - Hope This Helps.. not my name..

Rigga. (This is my name.. ) ;-)
 
Back
Top