I’m trying to enable the drawing tools in my Visio object with C# (if you have a hint in VB it’s welcome!). What I need is NOT the .DrawLine(shape, x1, y1, x2, y2) function, but changing the current mode (selection) by the drawing mode (line, rectangle or whatever shape I can select).
Any hint?
It’s not clear what you are trying to do. Why do you want to change the selected drawing tool?
If all you want to do is change the selected drawing tool you can use the DoCmd method on the Application object. These two statements in VBA will change the drawing tool to the Line tool and Rectangle tool respectively:
For more see DoCmd/DOCMD Commands on MSDN.
DoCmd may not do what you expect if the current window is not a drawing window or if the application is in a modal state. You should guard against such a state and expect DoCmd to return an error and/or throw an exceptions.