Re: Actions i WinForms (C#) ?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



eramfelt@xxxxxxxxx wrote:
I have a question on what the "proper" way is to link Controls and
logic? At my current project, which is a C# .NET 2.0 GUI application,
they use events to listen on buttons/lists/menu items. Ie. the code for
linking an action/logic to a button it looks like btn_Clicked(), and so
on (list_DblClicked(), list_KeyUp(), etc.) Is this the preferred way to
link control and logic?

I've written a little extender/provider component to add an "Action" property to buttons, menu items etc. Each "action" has an "Execute" event and all the properties you'd expect - Text, Enabled, ToolTipText etc - which flow through to the controls the action is bound to.

I haven't made it publicly available, but if you email me I'd be happy to send you the DLL.

Matt
.


Quantcast