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 / Visual Studio.NET / Extensibility / May 2006

Tip: Looking for answers? Try searching our database.

CodeModel How to connect Components to  Eventsmethods

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martin Stave - 03 May 2006 12:55 GMT
By using IDesignerHost I am able to create components and add them to a
form. Using FileCodeModel I can navigate in my code to find an insertion
point and then inject a method by means of  StartPoints and CreateEditPoint.

Lets say I have injected the Form_Load method into the class (file), how can
I connect it to the Form's Load event ?

There must be a better way than to traverse the (designer owned)
initialisation code for the form, find an appropriate spot and inject
something like :

"this.Load += new System.Eventhandler)this.Form1_Load);" ++++

regards

Martin Stave
Carlos J. Quintero [VB MVP] - 03 May 2006 15:35 GMT
Use the System.ComponentModel.Design.IEventBindingService to get/set event
handlers.

Signature

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com

> By using IDesignerHost I am able to create components and add them to a
> form. Using FileCodeModel I can navigate in my code to find an insertion
[quoted text clipped - 13 lines]
>
> Martin Stave
Martin Stave - 03 May 2006 19:27 GMT
Fantastic! It really worked.
Thanks a lot

Martin Stave

> Use the System.ComponentModel.Design.IEventBindingService to get/set event
> handlers.
> Carlos J. Quintero
Martin Stave - 03 May 2006 19:36 GMT
Fantastic! It really worked.
Thanks a lot

Martin Stave

> Use the System.ComponentModel.Design.IEventBindingService to get/set event
> handlers.
> Carlos J. Quintero

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.