473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

C# ;Error when displaying flow graph

20
I have downloaded a GLEE(Graph Layout Execution Engine) and written the following code to display a windows form from a web page but i am encountering with a small problem on displaying the graph into the display and I am getting the following error when I run the web page.Can anybody solve this problem. I would be very grateful. Thanks

Error:
System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

Code:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using Microsoft.Glee;
using Microsoft.Glee.Splines;

public partial class Flow : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//create a form
System.Windows.Forms.Form form = new System.Windows.Forms.Form();

//create a viewer object
Microsoft.Glee.GraphViewerGdi.GViewer viewer = new Microsoft.Glee.GraphViewerGdi.GViewer();

//create a graph object
Microsoft.Glee.Drawing.Graph graph = new Microsoft.Glee.Drawing.Graph("graph");
//create the graph content
graph.AddEdge("A", "B");
graph.AddEdge("B", "C");
graph.AddEdge("A", "C").EdgeAttr.Color = Microsoft.Glee.Drawing.Color.Green;
graph.FindNode("A").Attr.Fillcolor = Microsoft.Glee.Drawing.Color.Magenta;
graph.FindNode("B").Attr.Fillcolor = Microsoft.Glee.Drawing.Color.MistyRose;
Microsoft.Glee.Drawing.Node c = graph.FindNode("C");
c.Attr.Fillcolor = Microsoft.Glee.Drawing.Color.PaleGreen;
c.Attr.Shape = Microsoft.Glee.Drawing.Shape.Diamond;

//bind the graph to the viewer
viewer.Graph = graph;

//associate the viewer with the form
form.SuspendLayout();

viewer.Dock = System.Windows.Forms.DockStyle.Fill;
form.Controls.Add(viewer);
form.ResumeLayout();

//show the form
form.ShowDialog();

}
}
Oct 16 '07 #1
0 2321

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: ourspt | last post by:
Hi, We are working on an ASP.NET (VB.NET) application. In one of the screens of our application, we need to show a graph and for this we are using MS Excel Graph control. We have the graph ...
2
by: MLH | last post by:
A97 Am having difficulty displaying graph in Form View that I see fine in graph control on form opened in design view. I know I'm doing something wrong. If I open the form in design view - I...
2
by: brianlum | last post by:
Hi, I have been looking for a good way to convert python code into a control flow graph. I know of Python functions that will convert an expression into an abstract syntax tree (i.e. ast =...
0
by: kellyonlyone | last post by:
E-XD++ MFC Library Enterprise Edition V9.80 is released (100% Source Code)! ("The only Flow/Diagramming Kits that provides full source code of components for MFC and ActiveX in a single package!")...
0
by: jacksparrowminion | last post by:
Hi I want to do a simple control flow graph tool that generates a graph for the user i .e. the circles and arrows that make up a control flow graph used in program testing. Do you have any idea...
3
by: David Golightly | last post by:
I'm taking a stab at making CSS sparklines - see http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR&topic_id=1&topic= <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC...
11
by: jakester | last post by:
I am using Visual C++ 2007 to build the code below. I keep getting linkage error. Could someone please tell me what I am doing wrong? The code works until I start using namespace for my objects. ...
5
by: mukeshrasm | last post by:
Hi I am working on gd library with PHP to create graphs which is displaying correctly. But I want to display some information about this graph as text which will not be part of this graph means...
4
by: EmilyA | last post by:
Hi! I'm not that good at programming, so I was wondering if anyone could tell me why I'm getting an unreachable statement error for lines 18, 35, 68, and 86. import java.util.ArrayList; ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.