The 'AddressOf' expression has no effect in this context because the method argument to 'AddressOf' requires a relaxed conversion to the delegate type of the event. Assign the 'AddressOf' expression to a variable, and use the variable to add or remove the method as the handler.
Any ideas?
Title: Re: LayoutManager.Current.LayoutSwitched Event
Post by: Keith Brown on August 28, 2014, 11:47:03 AM
Maybe you can instead monitor the Application.SystemVariableChanged event and look for "Ctab". This will give you the name of the current layout. Store the current value and then when the variable changes compare it to the current variable and see if it changed. If so then update the current variable and then do your processing. The CTAB variable is per document so it should solve your problems in theory.