.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Running registered commands from contextmenu

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
336 Views, 2 Replies

Running registered commands from contextmenu

Hi,

 

I need some help regarding how to run registered commands from contextmenu. I've successfully created the contextmenu and I am calling directly the subroutines, but what will be the best approach, using sendstringtoexecute? After all I've read, sendstringtoexecute is not recommended all the time. The reason why I want this is to simplify rerunning a command through right-click menu.

 

Thank you,

 

George

2 REPLIES 2
Message 2 of 3
chiefbraincloud
in reply to: Anonymous

The context menu click handler should be a separate sub that uses SendStringToExecute to call your command method.

 

I don't remember what error I got, but when I tried to make the handler call the Sub directly, it gave me a runtime error.

Dave O.                                                                  Sig-Logos32.png
Message 3 of 3
Anonymous
in reply to: Anonymous

Right now I have the code directly in the handler and it is working ok, but to repeat the command I have to right-click again and choose the command (actually from  the submenu). I f I separate the code into a different sub and use SendStringToExecute, the code won't work first time because it is asynchronous (I think), though I will get the command in "Repeat Command" and "Recent Command" and this is what I want too, but I feel that I am missing something and I don't know what.

 

Thanks,

 

George

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report