Change active tab via code

Check this thread: