J
Jyothi
Hi
I have Created a Visio drawing control on to my C# windows form and when i
try to access drawing control objects like
VisApp = (Visio.Application)axDrawingControl1.Window.Application;
its giving InvalidActiveXStateException for axDrawingControl1.Window
any suggestions?
Here is my code
resources = new System.Resources.ResourceManager(typeof(Form2));
this.axDrawingControl1 = new
AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl()
((System.ComponentModel.ISupportInitialize)(this.axDrawingControl1)).BeginInit();
this.SuspendLayout();
//
// axDrawingControl1
//
// this.axDrawingControl1.AccessibleRole =
System.Windows.Forms.AccessibleRole.TitleBar;
this.axDrawingControl1.Enabled = true;
this.axDrawingControl1.Location = new System.Drawing.Point(88, 16);
this.axDrawingControl1.Name = "axDrawingControl1";
this.axDrawingControl1.OcxState =
((System.Windows.Forms.AxHost.State)(resources.GetObject("axDrawingControl1.OcxState")));
this.axDrawingControl1.Size = new System.Drawing.Size(648, 528);
this.axDrawingControl1.TabIndex = 19;
this.components = new System.ComponentModel.Container();
this.Size = new System.Drawing.Size(300,300);
this.Text = "Form2"
((System.ComponentModel.ISupportInitialize)(this.axDrawingControl1)).EndInit();
VisApp = (Visio.Application)axDrawingControl1.Window.Application;
VisPage = (Visio.Page) axDrawingControl1.Document.Pages[1];
VisWindow = (Visio.Window) axDrawingControl1.Window;
VisDocument = (Visio.Document) axDrawingControl1.Document;
VisDocuments = (Visio.Documents)
axDrawingControl1.Window.Application.Documents;
VisStencil = VisApp.Documents.Add("Basic shapes.vss");
VisMaster = VisStencil.Masters.Add();
VisMaster.Name = "Rectangle";
VisMaster = VisStencil.Masters[("Rectangle")];
VisShape = VisApp.ActivePage.Drop(VisMaster, 4, 4);
VisShape.Text = "HELLO WORLD";
thanks
Jyothi
I have Created a Visio drawing control on to my C# windows form and when i
try to access drawing control objects like
VisApp = (Visio.Application)axDrawingControl1.Window.Application;
its giving InvalidActiveXStateException for axDrawingControl1.Window
any suggestions?
Here is my code
resources = new System.Resources.ResourceManager(typeof(Form2));
this.axDrawingControl1 = new
AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl()
((System.ComponentModel.ISupportInitialize)(this.axDrawingControl1)).BeginInit();
this.SuspendLayout();
//
// axDrawingControl1
//
// this.axDrawingControl1.AccessibleRole =
System.Windows.Forms.AccessibleRole.TitleBar;
this.axDrawingControl1.Enabled = true;
this.axDrawingControl1.Location = new System.Drawing.Point(88, 16);
this.axDrawingControl1.Name = "axDrawingControl1";
this.axDrawingControl1.OcxState =
((System.Windows.Forms.AxHost.State)(resources.GetObject("axDrawingControl1.OcxState")));
this.axDrawingControl1.Size = new System.Drawing.Size(648, 528);
this.axDrawingControl1.TabIndex = 19;
this.components = new System.ComponentModel.Container();
this.Size = new System.Drawing.Size(300,300);
this.Text = "Form2"
((System.ComponentModel.ISupportInitialize)(this.axDrawingControl1)).EndInit();
VisApp = (Visio.Application)axDrawingControl1.Window.Application;
VisPage = (Visio.Page) axDrawingControl1.Document.Pages[1];
VisWindow = (Visio.Window) axDrawingControl1.Window;
VisDocument = (Visio.Document) axDrawingControl1.Document;
VisDocuments = (Visio.Documents)
axDrawingControl1.Window.Application.Documents;
VisStencil = VisApp.Documents.Add("Basic shapes.vss");
VisMaster = VisStencil.Masters.Add();
VisMaster.Name = "Rectangle";
VisMaster = VisStencil.Masters[("Rectangle")];
VisShape = VisApp.ActivePage.Drop(VisMaster, 4, 4);
VisShape.Text = "HELLO WORLD";
thanks
Jyothi