Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Sunday, December 17, 2006 11:33:20 PM(UTC)
przemekg

Groups: Registered
Posts: 8


I create my automation objects manually and I want to have to objects of the same type for example two AnnNoteObject tools. For one of them I want to display the context menu (after right click) so I create it as follows:

noteObj.ContextMenu = manager.CreateDefaultObjectContextMenu(noteObj.Id);

But for the second note object I don't want to display the context menu so I set it to null.

Unfortunatelly the result is that the context menu is always displayed for both object. If I change the objects creation order (for first object context menu is set to null) then the context menu is not displayed for both objects. Of course I create the AnnAutomationObject with different identifiers.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, December 19, 2006 4:46:53 AM(UTC)

Qasem Lubani  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)


You can supply your own derived class to the
ContextMenu property, and in this class examine which object was being clicked and decide whether to display the menu or not.

 
#3 Posted : Tuesday, December 19, 2006 4:57:59 AM(UTC)
przemekg

Groups: Registered
Posts: 8


Could you provide me some example code? Where should I examine (what event) whether the context menu should be displayed or nor?

In my opinion if I set the default menu for a first note object and null for the second note object then the context menu should appear only for first object not for both.
 
#4 Posted : Thursday, December 21, 2006 7:43:23 AM(UTC)

Qasem Lubani  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)


You can implement a PopUp event handler for the
ContextMenu class, and in this event examine which object was being clicked and decide whether to display the menu or not.


I have attached to this post the file "Mianform.cs"
for the "C# annotation automation demo", in which I modified the code
to hide context menu from popping up for any Note object whose text is
"A". To find my modifications search for the word "NoteMenu".

File Attachment(s):
MainForm.zip (15kb) downloaded 34 time(s).
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.073 seconds.