First of all, you should put UI code in proper order: instead of handling all those buttons and text boxes on ad-hoc basis normally offered by the Designer. Instead, you need to abstract out the set of centralized actions which are called on raw control events, such as button click, text change (by the way, not so easy in
, unlike some other libraries; you will have to handle raw mouse/keyboard events and then see if the text is changed), selection changes, and so on. This way, for example, if the same logical action is invoked when you click on a button or hit a default key, will be handled by the same action.
When this is done, you can (optionally) add logging to each of those actions. One ready-to-use logging tool is
It writes the logs to the system event log, but the sink of the log data can be customized, as well as nearly all other relevant detail. Please see my past answers:
MsBuild OutPut to the TextBox on the fly in Windows Application
How to create event log under a folder
And yes, as Wes Aday recommended, there is another option, log4net: