I have a windows forms application with controls like text box, combobox, datagridview, etc. These controls allow the user to use clipboad, i.e. cut / copy and paste text. You can also delete text (which is not associated with the clipboard).
In my application, there is a menu bar with the "Edit" element containing the "Cut / Copy / Paste / Delete" elements, as well as a toolbar with these elements. How can I properly enable / disable these elements depending on the state of the control with focus?
I am looking for a general way, i.e. I'm looking for an implementation that I do once, and can reuse for the future regardless of the controls that my application will use.
winforms
nruessmann
source share