I'm writing a program in Visual Basic 2010. It's a HMI (Human-Machine Interface) and therefore has a whole whack of buttons that just send commands to other devices. As a result, there are a huge pile of event handlers for clicking buttons that can't really be broken down into modules (unless my understanding of modules is wrong).
Essentially, I'd like to be able to move all the event handlers, for, say, button presses to a different file. Can this be done or is it important that they stay in "MainWindow.xaml.vb"? (All my buttons reside in one fullscreen window, some are hidden by tabs).
Thanks,
--Erik T
You can use Partial Classes to break up your class definition into multiple files which might help organize your code.
The link above will help explain exactly how to use Partial Classes. The following link will show you the VB.NET Syntax (and how to use Class Designer to split things up):
How to: Split a Class into Partial Classes
Sure use partial class. Check this article,
http://visualbasic.about.com/od/usingvbnet/a/partclses.htm
You can use Partial Classes to split these into separate files, if required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With