troubleshooting Question

ExtenderProvider invalidated event problems...

Avatar of dpbouchard
dpbouchardFlag for United States of America asked on
.NET ProgrammingVisual Basic.NET
2 Comments1 Solution224 ViewsLast Modified:
VB.NET 2005

I have a component class that adds several provider extensions to a form and one of them is a Required property along with a Required color property and a Satisfied color property.  I add a xxxChanged event handler that checks to see if the control's text is empty and if it is, I set the backcolor of that field to the Required color and if it is not empty, then I set it to the Satisified color.  I was having trouble before with trying to get the control (textbox, combobox, etc.) painted initially until I started handling the Invalidated event.  This worked fine for the textbox, combobox but failed for the NumericUpDown control.  It fails with an infinite loop where the invalidated event triggers the text changed event triggering the invalidated event, ad nauseum.  So, then I thought that perhaps I might trap the Paint event of the container that contains the control I'm extending, but I've not been too successful with this approach.  Is there an event I can trap for a control when it is first displayed on a screen so that I can set its initial backcolor correctly depending on if it is empty or not?
ASKER CERTIFIED SOLUTION
dctuck

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros