kiranboi
asked on
Changing a TextBox BackColor at runtime
I have a series of TextBoxes on my form and I want to be able to programatically change their Back Color to the 'Control' system color.
If I set the color in the control properties at design time it works fine but if I try to set it using:
txtboxInvoiceToCode.BackCo lor = System.Drawing.Color.FromK nownColor( KnownColor .Control)
during runtime all it does is change the BackColor where the text is and leaves the rest of the control's BackColor as white.
Can someone tell me how I can change this properly.
Thanks
If I set the color in the control properties at design time it works fine but if I try to set it using:
txtboxInvoiceToCode.BackCo
during runtime all it does is change the BackColor where the text is and leaves the rest of the control's BackColor as white.
Can someone tell me how I can change this properly.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ahh, ive sorted it. The TextBox had its ReadOnly property set to True. For some reason this seems to effect changes to the BackColor.
Thanks for answering me tho, Ill give you the points anyway
Thanks for answering me tho, Ill give you the points anyway
eazyest points ever....
ASKER