Nov 9, 2012 at 7:27 PM
Edited Nov 9, 2012 at 7:28 PM
The Visual Studio designer won't let you add a WPF control like NodeXLControl to a Windows Forms form. (At least, I've never figured out a way to get Visual Studio to do that.) It
will let you add an ElementHost to the form, but you have to "manually" create the WPF control in code and add it to the form as the child of the ElementHost.
Setting the NodeXLControl's properties in code is trivial. For example:
nodeXLControl1.ShowVertexToolTips = true;
To handle the NodeXLControl's events in code, you use standard C# event handling syntax:
nodeXLControl1.SelectionChanged += new System.EventHandler(nodeXLControl1_SelectionChanged);
To add a context menu to the NodeXLControl, you would handle its GraphMouseUp event and show a ContextMenuStrip in the event handler.