PC Review


Reply
Thread Tools Rate Thread

Custom Component Problem - ANY help appreciated

 
 
Alexander Kolev
Guest
Posts: n/a
 
      27th Jul 2004
I'm writing a .Net component in C#. Let's name it component A. This
component
represents a collection of other .net components ( component B ) that are
not visible design
time in VS 2003. Component B provides several events. I take advantage of
the .net Collection
Editor and the addition and removal of those components (B) is done only
through component A's
property that returns the collection of B components.

What is the problem - I couldn't find ANY way to make the collection editor
show the events
for the items in the collection. By default it only shows their properties
and not the events.
And I really need access to those events in order to avail the user to
attach to them.

My solution:

I provided an external events tab for component A. This tab (derivative of
System.Windows.Forms.Design.EventsTab) overrides the GetProperties method
and iterates through
all items in A's collection, gathers their events, sets unique category
names and returns them.
The result is a beautiful customized tab, that lists the events of all items
(of type B) that it
contains.So far so good.

Unfortunately this approach turned out to have issues. When you double click
on an event in the
standard events tab the designer generates for you a method of the
appropriate delegate type
and binds it to your event in the InitializeComponents() method of the
windows form that
contains the component. Providing the custom event tab that lists all items
of type B in the
component A's collection solves half the problem - it lists all items'
events, but when you
double click them the designer generates the appropriate method but then it
seems that it looks
for the event in component A, which does not have such. So after failing to
find the event
no code is generated for attaching it.

I tried several solutions but none of them solved the problem.
I don't have much experience in programming .Net components and I would
really appreciate
any help on this issue.

Thanks in advance,
Alex


 
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
Suggest New Component? Advice Appreciated k3n7 General 8 10th Dec 2007 08:47 PM
Solving Problem :C# VS 2005 Custom Component doesn't appears in ToolBox bar Alex0035@gmail.com Microsoft C# .NET 0 11th Sep 2007 12:18 PM
Custom component problem =?Utf-8?B?UmFjb250ZXVy?= Microsoft Dot NET 3 2nd Aug 2005 02:50 PM
The system has called a custom component and that component has failed and generated an exception. lil_miss_sassy_girl@yahoo.com Microsoft Windows 2000 Developer 0 31st Jan 2005 05:23 PM
Problem with Files for Custom Component Yeghia Windows XP Embedded 7 24th Aug 2004 10:04 PM


Features
 

Advertising
 

Newsgroups
 


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