Re: Provider Properties + IExtenderProvider

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Bob Powell [MVP] (bob_at__spamkiller_bobpowell.net)
Date: 11/23/04


Date: Tue, 23 Nov 2004 15:55:42 +0100

You can return true to all cases from CanExtend. You might do this if you
wanted to provide a property for anything based on Component for example.

The IExtenderProvider only enables you to add a property at design time. You
can't add an event.

It's important to note that the property isn't really added to the object.
This is just a design time trick that enables the IDE to make the user think
that the object has properties it doesn't. At runtime those properties do
not exist and must be handled by the property provider itself. More
particularly, the object being extended has no knowledge that the addition
has taken place and so for it to magically gain an event in this manner
would make no sense.

Maybe you should explain in detail what you want to do rather than speculate
on the operation of the extender provider. There may be another way to
answer the question.

-- 
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"WXS" <WXS@discussions.microsoft.com> wrote in message
news:B4425918-BDFB-45AA-A548-4B8E15ABB775@microsoft.com...
> Is there any way to create an extender that provides an event to all
controls
> that
> I return CanExtends==true for?  It seems I can provide properties, like
> strings, bools, ints, but not events to other controls.
>
> The reason I would like to do this is so I can associate an event with the
> control and have the designer automatically add the event handler for me
when
> the user double clicks the event in the event pane of the designer for the
> control.
>
> Is there a way to do this?
> Thanks,
> Dave


Relevant Pages

  • User-control with multiple control containers - design-time issue (mimicing the TabContr
    ... your control so that it works as a container at design time. ... With the help of these articles I was able to have the first TabPage act as ... selectable so that I one can drop controls into it. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • User-control with multiple control containers - design-time issue (mimicing the TabContr
    ... your control so that it works as a container at design time. ... With the help of these articles I was able to have the first TabPage act as ... selectable so that I one can drop controls into it. ...
    (microsoft.public.dotnet.framework.windowsforms.designtime)
  • Re: Best approach... Reposting...
    ... When you're ready to post the data, Add a new row to the dataset, populate ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... Answer those GDI+ questions with the GDI+ FAQ ... > an initial record hasn't been retrieved to populate the controls (to ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: need to add textboxes to userform on the fly
    ... Sorry Bob, ... design time and adapting their Visible, ... >It is indeed possible to add controls tom a userform on ... >Dim newButton As MSForms.Control ...
    (microsoft.public.excel.programming)
  • Re: create design time library using vs.net
    ... > writing controls with design time support isn't the issue, my controls also> have design time support which works just peachy. ... >>> multiple places; using definition from ... You must add a reference to assembly ...
    (microsoft.public.dotnet.framework.compactframework)