Exception with ErrorProvider

M

Mike Livenspargar

The following exception occurs when I assign a value to the
ErrorProvider control on my form:

Window Handle already exists.
at System.Windows.Forms.NativeWindow.CheckReleased()
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.ErrorWindow.EnsureCreated()
at System.WIndows.Forms.ErrorWindow.Add(ControlItem item)
at System.Windows.Forms.ControlItem.AddToWindow()
at System.Windows.FOrms.ControlItem.set_Error(String value)
at System.Windows.Forms.ErrorProvider.SetError(Control control,
String value)
at
System.Window.Forms.ErrorProvider.ErrorManager_CurrentChanged(Object
sender, EventArgs e)
at System.Windows.Forms.ErrorProvider.UpdateBinding()
at System.Windows.Forms.ErrorProvider.Set_ErrorManager(Object
newDataSource, String newDataMember, Boolean force)
at System.Windows.Forms.ErrorProvier.set_DataSource(Object_value)


I'm assigning an IBindingList object to myErrorProvider.DataSource.
myErrorProvider is declared in a base class UserControl from which the
current UserControl is derived. This arrangement seems to work fine in
a number of other controls, and occasionally even works in this
control. Where should I look to determine how to correct this error?

Thanks,
Mike
 
Y

Ying-Shen Yu[MSFT]

Hi Mike,
I apologize for the long delay. To my understanding, you are using
ErrorProvider with a data-bound control. Due to the limited information, I
couldn't find out the problem, however, I'd like to know if you have set a
ContainerControl for ErrorProvider?
When using ErrorProvider with data-bound controls,
you must specify the ContainerControl, either in the constructor or by
setting the ContainerControl property.

If you still have problems on this issue, please let me know, thanks!


Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" should be removed before
sending, Thanks!

--------------------
| From: Mike Livenspargar <[email protected]>
| Subject: Exception with ErrorProvider
| Date: Tue, 30 Sep 2003 14:29:56 -0700
| Message-ID: <[email protected]>
| X-Newsreader: Forte Free Agent 1.93/32.576 English (American)
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| NNTP-Posting-Host: 209-77-204-223.sonoma-county.org 209.77.204.223
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:53469
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| The following exception occurs when I assign a value to the
| ErrorProvider control on my form:
|
| Window Handle already exists.
| at System.Windows.Forms.NativeWindow.CheckReleased()
| at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
| at System.Windows.Forms.ErrorWindow.EnsureCreated()
| at System.WIndows.Forms.ErrorWindow.Add(ControlItem item)
| at System.Windows.Forms.ControlItem.AddToWindow()
| at System.Windows.FOrms.ControlItem.set_Error(String value)
| at System.Windows.Forms.ErrorProvider.SetError(Control control,
| String value)
| at
| System.Window.Forms.ErrorProvider.ErrorManager_CurrentChanged(Object
| sender, EventArgs e)
| at System.Windows.Forms.ErrorProvider.UpdateBinding()
| at System.Windows.Forms.ErrorProvider.Set_ErrorManager(Object
| newDataSource, String newDataMember, Boolean force)
| at System.Windows.Forms.ErrorProvier.set_DataSource(Object_value)
|
|
| I'm assigning an IBindingList object to myErrorProvider.DataSource.
| myErrorProvider is declared in a base class UserControl from which the
| current UserControl is derived. This arrangement seems to work fine in
| a number of other controls, and occasionally even works in this
| control. Where should I look to determine how to correct this error?
|
| Thanks,
| Mike
|
 
Y

Ying-Shen Yu[MSFT]

Hi Mike,
I think it will be helpful if you could give some code snippet or a sample
project to reproduce the problem, thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" should be removed before
sending, Thanks!

--------------------
| From: Mike Livenspargar <[email protected]>
| Subject: Exception with ErrorProvider
| Date: Tue, 30 Sep 2003 14:29:56 -0700
| Message-ID: <[email protected]>
| X-Newsreader: Forte Free Agent 1.93/32.576 English (American)
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| NNTP-Posting-Host: 209-77-204-223.sonoma-county.org 209.77.204.223
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:53469
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| The following exception occurs when I assign a value to the
| ErrorProvider control on my form:
|
| Window Handle already exists.
| at System.Windows.Forms.NativeWindow.CheckReleased()
| at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
| at System.Windows.Forms.ErrorWindow.EnsureCreated()
| at System.WIndows.Forms.ErrorWindow.Add(ControlItem item)
| at System.Windows.Forms.ControlItem.AddToWindow()
| at System.Windows.FOrms.ControlItem.set_Error(String value)
| at System.Windows.Forms.ErrorProvider.SetError(Control control,
| String value)
| at
| System.Window.Forms.ErrorProvider.ErrorManager_CurrentChanged(Object
| sender, EventArgs e)
| at System.Windows.Forms.ErrorProvider.UpdateBinding()
| at System.Windows.Forms.ErrorProvider.Set_ErrorManager(Object
| newDataSource, String newDataMember, Boolean force)
| at System.Windows.Forms.ErrorProvier.set_DataSource(Object_value)
|
|
| I'm assigning an IBindingList object to myErrorProvider.DataSource.
| myErrorProvider is declared in a base class UserControl from which the
| current UserControl is derived. This arrangement seems to work fine in
| a number of other controls, and occasionally even works in this
| control. Where should I look to determine how to correct this error?
|
| Thanks,
| Mike
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top