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
2765
How to change the Index of a button tool?
posted

I am adding tool items to a toolbar pragmatically. Everything is fine except i am unable to change the index of tool items through code. The index property of ButtonTool is read only. Is there any way to change the index of button tools through code?  Any Idea?

 Thanks,

Parents
No Data
Reply
  • 45049
    Verified Answer
    posted

    I can't find a one-step way to move items within a toolbar.  However, since you're programmatically adding them anyway, you could probably use the Insert() method off the Tools collection, rather than using the Add() method to add the tool to the end.

    In the absence of a better approach, the way I'd move a tool is to get a reference to the instance in the toolbar, remove it from that toolbar's Tools collection, and then insert it back to the Tools collection where I want it.

Children