Function on dialog focus

Function on dialog focus


Can anyone suggest the best way to trigger a function on focus on a
dialog?