SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Code completion: one EventHandler for several Controls

Last post 08-15-2008 11:18 PM by Jason Brenton. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-28-2007 2:01 PM

    Code completion: one EventHandler for several Controls

    In this situation, I have to do the following steps:

    • switch to designer mode
    • mark one control
    • switch to property grid
    • switch to events page
    • double click on the wished EventHandler
    • write the code
    • switch to designer mode again
    • mark the next control
    • switch to property grid
    • switch to events page
    • choose my EventHandler for this control
    • redo these steps for all the other controls

    I'ld prefer a simplier way: Choose all the controls in a CheckedListBox, choose one EventHandler in a ComboBox with all events that are available to all the chosen controls, create the method template, add the EventHandler to all these controls in the .Designer.cs

    Perhaps, this way could be integrated in the ShowCompletionWindow() method. But the integration of CheckedListBox and ComboBox could be a little bit more complicated. Therefore, a better way could be the ContextMenu after writing the code for the first control as a MenuItem "Add this EventHandler to other controls".

     Juergen

    until now Version 2.2.1.2648

    Software fuer Verlage (Publishers)
    #D + NET 2.0 + Firebird 2.0
    (formerly Delphi 5 + 2005 Pro)
  • 10-29-2007 6:00 PM In reply to

    Re: Code completion: one EventHandler for several Controls

    Try it like this:

    • Switch to designer mode.
    • select all controls you whish
    • double-click event handler
    • rename the event handler if required.

    The controls must be of the same type (i think).

     

    jacques. 

  • 08-15-2008 11:18 PM In reply to

    Re: Code completion: one EventHandler for several Controls

    interesting bit. how about a right click add that from design allows you to select the event you want to connect to?

Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.