Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / July 2004

Tip: Looking for answers? Try searching our database.

Custom component problem - ANY help appreciated

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alexander Kolev - 27 Jul 2004 09:17 GMT
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
Floyd Burger - 27 Jul 2004 23:31 GMT
Ran across this a few weeks ago
http://www.dacris.com/blog/archive/2004/05/23.aspx

Signature

Floyd Burger

> I'm writing a .Net component in C#. Let's name it component A. This
> component
[quoted text clipped - 47 lines]
> Thanks in advance,
> Alex
Alexander Kolev - 28 Jul 2004 08:06 GMT
Thanks for the reply.
This really solved my problem.

> Ran across this a few weeks ago
> http://www.dacris.com/blog/archive/2004/05/23.aspx
[quoted text clipped - 56 lines]
> > Thanks in advance,
> > Alex

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.