Cann`t draw node with specified coordinates on gViewer.
Try to using code from this question Change Node position in MSAGL , but it don`t works.
Form form = new ();
GViewer viewer = new ();
Graph graph = new ("graph");
graph.AddNode("test");
Microsoft.Msagl.Core.Geometry.Point position = new(100, 100);
graph.FindGeometryNode("test").Center = position;//exception in this line
viewer.NeedToCalculateLayout = false;
viewer.Graph = graph;
form.SuspendLayout();
viewer.Dock = System.Windows.Forms.DockStyle.Fill;
form.Controls.Add(viewer);
form.ShowDialog();
It throwing NullReferenceException.
Message:
"Object reference not set to an instance of an object."
Stack:
MsaglTestApplication.dll!MsaglTestApplication.Program.Main() Line 23 C#
New contributor
TA1989 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.