Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Studio
  4. Default Event Handler in VS.NET IDE Forms Designer

Default Event Handler in VS.NET IDE Forms Designer

Scheduled Pinned Locked Moved Visual Studio
visual-studiocsharpwinformstutorialquestion
3 Posts 2 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rondalescott
    wrote on last edited by
    #1

    You know how when you double-click on a control in the Visual Studio.NET Windows Forms Designer, it will take you to the code and generate an event handler for you, and bind the event up in the "generated code" region? Well my questions are: 1) How does it decide WHICH event to bind to? It seems like it picks the most commonly used one, but it also seems pretty arbitrary to me. 2) Is there any way to change this default behavior, for example to make a different event the default? 3) Is there any way to auto-generate handlers and bindings for other events besides the default one, sort of like you could do in VB? It's kind of a time-consuming pain to always have to go look up the event handler arguments and which delegate you're supposed to use every time. Thanks in advance Ron Scott

    O 1 Reply Last reply
    0
    • R rondalescott

      You know how when you double-click on a control in the Visual Studio.NET Windows Forms Designer, it will take you to the code and generate an event handler for you, and bind the event up in the "generated code" region? Well my questions are: 1) How does it decide WHICH event to bind to? It seems like it picks the most commonly used one, but it also seems pretty arbitrary to me. 2) Is there any way to change this default behavior, for example to make a different event the default? 3) Is there any way to auto-generate handlers and bindings for other events besides the default one, sort of like you could do in VB? It's kind of a time-consuming pain to always have to go look up the event handler arguments and which delegate you're supposed to use every time. Thanks in advance Ron Scott

      O Offline
      O Offline
      Oleksandr Kucherenko
      wrote on last edited by
      #2

      Hi! 1) DefaultEventAttribute attributes used by IDE for detecting what to do on click. 2) use DefaultEvent attribute in class declaration to make custom event a default for click 3) you can use CodeTemplate Addon for .NET IDE for more details about attribute please look into MSDN or www.dotnet247.com site Good Luck Alex Kucherenko

      R 1 Reply Last reply
      0
      • O Oleksandr Kucherenko

        Hi! 1) DefaultEventAttribute attributes used by IDE for detecting what to do on click. 2) use DefaultEvent attribute in class declaration to make custom event a default for click 3) you can use CodeTemplate Addon for .NET IDE for more details about attribute please look into MSDN or www.dotnet247.com site Good Luck Alex Kucherenko

        R Offline
        R Offline
        rondalescott
        wrote on last edited by
        #3

        Thanks for your reply, I'll look into that stuff!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups