Using AddHandler

I was wondering if I could use AddHandler for the following situation.
I have

  • a window with 2 container controls ( ccA and ccB)
  • ccA has a listbox
  • ccB has a textarea

if I double-click a listbox row, I want to copy a listbox column value to the TextArea of ccB

at the moment I’m using a global variable of the window and call a method of ccB to copy the value, but I don’t like using a global variable of a window.

can I do this using AddHandler and how ?

I discourage that plan. Instead, have ccA raise an event on double click, then implement that event in the window and use it to set the text area.

ok, I follow your advice

thanks Kem