PC Review


Reply
Thread Tools Rate Thread

UserControl delete from Form

 
 
Mark
Guest
Posts: n/a
 
      30th Apr 2009
Hi,

I write Windows Forms 2.0 application.
I have Form and I add dynamically a lot of UserControl to the form.
Than one of the user control has event (for example buutton click) and
I would like to delete all the controls from Form and add new one.

When in the same event I try to delete control, I have exceptions..
Why ?

How to delete (Dispose) controls from Form in user control event - in
one event ?

Thanks for help
 
Reply With Quote
 
 
 
 
Pavel Minaev
Guest
Posts: n/a
 
      30th Apr 2009
On Apr 30, 12:54*am, Mark <(E-Mail Removed)> wrote:
> I write Windows Forms 2.0 application.
> I have Form and I add dynamically a lot of UserControl to the form.
> Than one of the user control has event (for example buutton click) and
> I would like to delete all the controls from Form and add new one.
>
> When in the same event I try to delete control, I have exceptions..
> Why ?


Show the code that causes the exception, code of the user control, and
provide the description of that exception (type, message text etc).
Without it, there's no way to tell.

> How to delete (Dispose) controls from Form in user control event - in
> one event ?


Removing control from a form, and disposing the control, are two very
different things.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calendar Control in UserControl and look through usercontrol asp.n =?Utf-8?B?Y2hyaXM=?= Microsoft C# .NET 0 25th Mar 2005 02:15 AM
accessing usercontrol from another usercontrol Phl Microsoft ASP .NET 2 18th Nov 2004 08:33 PM
Access a control inside an usercontrol from another control inside another usercontrol nail Microsoft ASP .NET 0 15th Sep 2004 04:55 PM
Can we use a usercontrol inside a usercontrol Rajesh Tiwari Microsoft ASP .NET 0 12th Aug 2003 04:56 PM
Use LoadControl to load a usercontrol but the webcontrol in the usercontrol can not AutoPostBack huobazi Microsoft ASP .NET 1 3rd Jul 2003 04:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:17 PM.