Link to home
Start Free TrialLog in
Avatar of Kaprice
KapriceFlag for United States of America

asked on

Visual Studio: Copy control WITH all code?

In Visual Studio (2013, if it matters), is there a way to copy a control from one form to another and include all the code attached to that control? (IOW, all code that exists for every event.)
SOLUTION
Avatar of CooPzZ
CooPzZ
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kaprice

ASKER

Yeah, there's a LOT I need to learn. I'm an expert programming MS Access but finding the move to Visual Studio quite challenging.

So, you're saying rather than code events directly in the control's event, I should put all the code in a class and then just refer to the class in the control's event? And, doing that means no need to duplicate code if I need it in multiple forms, yes?

Can you share a snippet of how I would use, for example, your ButtonHover class on a button in my WinForm?

And, I assume I'd have one class for each event I needed to use more than once?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kaprice

ASKER

Eric, that's a pretty impressive tool with a ton of features. I'll consider that.