Search code examples
c#winformseventscontrol-array

C# handle control array event caused by another control


I am working on a winforms html editor with multiple editor windows as each editor window will be written to a database field.

I am creating the editor windows as a control array and was hoping to just have one toolbar above them that would handle the events such as apply bold, italic... based on the window I was currently in. Unfortunately obviously the event handler of an event on the toolbar doesn't know what the control selected before it was.

Is there a way to get this or should I be adding an onenter event to each editor window and storing statically the last editor window used.


Solution

  • I think that storing the windows, the HTML editor control or even just an index is the simplest option.