PC Review


Reply
Thread Tools Rate Thread

How to capture Add Control event on design time?

 
 
rizwanahmed24@gmail.com
Guest
Posts: n/a
 
      9th Jan 2007
Hello

I want to capture the event generated when a control (from toolbox) is
added on to the panel at design time. I tried overriding OnControlAdded
method, and capturing ControlAdded event but its not working.

here are the steps:

1. Create a Panel
2. Add the panel to the form (not necessary)
3. Compile
4. Add a control e.g. Button, from toolbox on to the panel

How can i capture this event at design time.

For error reproducing you can download sample project from following
link:
http://download.yousendit.com/1348E4247660593F

Regards
//Rizwan

 
Reply With Quote
 
 
 
 
Stoitcho Goutsev \(100\)
Guest
Posts: n/a
 
      9th Jan 2007
Rizwan,

If you are talking about OnControlAdded method/event that is declared on the
Control class level it won't do it for you. This event is fired when a
control is added as a child control of the one fired the event at runtime.
At design time you need to created a designer for and use
IComponentChangedService and its ComponentAdded event.


--
HTH
Stoitcho Goutsev (100)

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello
>
> I want to capture the event generated when a control (from toolbox) is
> added on to the panel at design time. I tried overriding OnControlAdded
> method, and capturing ControlAdded event but its not working.
>
> here are the steps:
>
> 1. Create a Panel
> 2. Add the panel to the form (not necessary)
> 3. Compile
> 4. Add a control e.g. Button, from toolbox on to the panel
>
> How can i capture this event at design time.
>
> For error reproducing you can download sample project from following
> link:
> http://download.yousendit.com/1348E4247660593F
>
> Regards
> //Rizwan
>



 
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
Capture an Event in a composite control From control on a page gdick@kerrhenderson.com Microsoft ASP .NET 1 10th Aug 2006 05:17 PM
Custom event in design-time Events tab for a Web user control George Jordanov Ivanov Microsoft ASP .NET 3 30th Mar 2006 10:43 AM
How do I capture an event from a control inside a container? Ken Sturgeon Microsoft ASP .NET 8 14th Mar 2006 05:51 PM
MouseEnter event for custom control isn't raised in design-time. Ilya Belomutov Microsoft Dot NET Framework Forms 0 27th Nov 2003 02:36 PM
Using Table control in a custom composite control. Control does not render properly in design time. jb_in_marietta@yahoo.com Microsoft ASP .NET 0 1st Jul 2003 10:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:53 PM.