1

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.

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

I went with this, just storing the index of the webbrowser on entry.
0

I'm not familiar with the types of events you mention, and I'm probably missing something, but it's common in WinForms development to have events fire and provide information about the sender as well as the event, conforming to the EventHandler delegate?

[SerializableAttribute]
[ComVisibleAttribute(true)]
public delegate void EventHandler(
    Object sender,
    EventArgs e
)

This is how System.Windows.Forms.Control.Click operates. Could you follow this example, where sender would be the editor window in each case?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.