/ Email me at: private void RefreshProviderErrors() / /// Todo: I would like to find an easier way to fix this. / if the user is able to hover over another error provider message for / you click on an error provider, while its tooltip is displayed, / /// Resets the error provider, error messages. MTmrCheckHandelsProc.Tick += new EventHandler(tmr_CheckHandels) / /// public ErrorProviderFixManager(ErrorProvider ep) / /// To do: I would like to do this without a timer (Suggestions welcome). / keep the errorProviders tooltip window up-to-date and enabled. / /// constructor, which will started a timer that will Private Hashtable mHashOfNativeWindows = new Hashtable() Private Timer mTmrCheckHandelsProc = null Private ErrorProvider mTheErrorProvider = null Public class ErrorProviderFixManager : IDisposable Protected override void Dispose( bool disposing) Public ErrorProviderFixed(IContainer container) Public ErrorProviderFixed(ContainerControl parentControl) MToolTipFix = new ErrorProviderFixManager( this) Public class ErrorProviderFixed : ErrorProviderĮrrorProviderFixManager mToolTipFix = null Then, replace all instances of with ErrorProviderFixed. To replace the Microsoft ErrorProvider with ErrorProviderFixed, all you need to do is include the following code in your project in a file such as ErrorProviderFixed.cs. I would much prefer it if Microsoft could fix this bug. Note: “*the trick” as explained above re-enables the messages so that they display, but causes a slight flicker. When we need to, we reset the error provider messages (re: *the trick). It looks at the ErrorProvider’s private member Windows and registers it with our own NativeWindow implementation, allowing us monitor its WinProc messages. The ErrorProviderFixed implementation, which follows, is a simple extension of the ErrorProvider. I have discovered that setting a control's error message to "" and then resetting it, will allow the error message to be re-displayed ( the trick*). When you move the mouse off the error provider icon and return it will not re-appear. Next, click the mouse and the error message goes away. When you hover over the Microsoft error provider, the error message is displayed. To better understand the problem, run the demo app included as a download to this post.
0 Comments
Leave a Reply. |