Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
710
Set ActiveItem
posted

How to set ActiveItem programatically. When I'm trying explorerBar.ActiveItem = explorerBar.ActiveGroup.Items[0] it throws an ArgumentException with message ActiveItem cannot be set - specified Item cannot be activated! (Item may be disabled or have a style that is not activatable like Separator or Label).

Style which is used for this instance is VisualStudio2005Toolbox.

Parents
No Data
Reply
  • 71886
    Offline posted

    Hello PoKrec,

    I believe that this exception is telling you that the style of the item is a Separator or a Label, it is not about the style of the control.

    So I tried this and it always works fine for me so I attached my sample to this post for you. Please review it and feel free to let me know if I misunderstood you or if you have any other questions.

    ActiveItemInCode.zip
Children