One way of doing it is double-clicking on each component and it开发者_开发百科 will automatically create a method for you in Code-Behind file.
But what if you have many components in your project, is there a quicker way to generate those methods rather than by double-clicking on each and every component?
Hold down Control and select all of the components, go the the Events tab in the Properties window, and double-click the Click event. It will create one event handler and attach it to the Click event of all the components you selected.
Of course, the designer is just generating code, so you could also wire them up by editing the code by hand or with another tool.
精彩评论