ArcGIS Conrols in different Windows Forms (Communication)

919
7
02-13-2011 10:43 PM
MichaelBreitfeld
New Contributor
Hello,

I'm new in ArcGIS Engine an C# Development.
Is it possible to connect ArcGIS Controls (TocControl, MapControl, ToolbarControl,...) in different windows form elements? All Controls in one windows form it is easy with the help of the BuddyControl (Esri-Help).

How can I solve this problem?
What happens with the LicenceControl?

Thank you very much!
0 Kudos
7 Replies
Venkata_RaoTammineni
Occasional Contributor
Hello,

I'm new in ArcGIS Engine an C# Development.
Is it possible to connect ArcGIS Controls (TocControl, MapControl, ToolbarControl,...) in different windows form elements? All Controls in one windows form it is easy with the help of the BuddyControl (Esri-Help).

How can I solve this problem?
What happens with the LicenceControl?

Thank you very much!


HI,

I dont know what exactly you are looking for .. as per my understanding...

You need to have arcgis engine runtime if you want to use arcgis engine controls.. on windows form...if you dont have arcgis engine not installed in you computer ... You will get licence error....Now tell me what you are looking for..
0 Kudos
MichaelBreitfeld
New Contributor
Hi,
I try to explain it.
I have ArcGIS Engine 2010 Developer Kit and VS2010.
The goal is to create an application with ArcGIS Engine. This application consists of several windows forms elements. And in these elements the different Controls were placed.

My questions:
How works the communication between these separate forms?
Is it possible?

The BuddyControl only finds connections in the same Windows Form (default case, find in ESRI help).

Can you help me, please?

Thank you.
0 Kudos
Venkata_RaoTammineni
Occasional Contributor
Hi,
I try to explain it.
I have ArcGIS Engine 2010 Developer Kit and VS2010.
The goal is to create an application with ArcGIS Engine. This application consists of several windows forms elements. And in these elements the different Controls were placed.

My questions:
How works the communication between these separate forms?
Is it possible?

The BuddyControl only finds connections in the same Windows Form (default case, find in ESRI help).

Can you help me, please?

Thank you.


That is what... like you suppose to install Arc Engine runtime.. if you want to use arc engine control on windows form...if you installed arcengine runtime..controls will be integrating with VS.net...namespace will be integrated with VS.net framework..Something like Cristal reports controls ..etc.. Licence control will be playing as key for Licences.. and BudyControl depends on parent control.. something like if map control and Toc control... Map control will playing role as buddycotnrol for TocControl....
0 Kudos
MichaelBreitfeld
New Contributor
Yes, that's right.

But I get an error.
I have two windows forms: frmMap.cs and frmToc.cs
There is no connection between MapControl and TocControl.

Code in frmToc.cs ends in an error, because I cannot reference the axMapControl1 object.

this.axTOCControl1.SetBuddyControl(......);

Is there a solution for this problem?

Thank you.
0 Kudos
Venkata_RaoTammineni
Occasional Contributor
Yes, that's right.

But I get an error.
I have two windows forms: frmMap.cs and frmToc.cs
There is no connection between MapControl and TocControl.

Code in frmToc.cs ends in an error, because I cannot reference the axMapControl1 object.

this.axTOCControl1.SetBuddyControl(......);

Is there a solution for this problem?

Thank you.


Hey,

You should not use two windows forms.. you should use only use one windows form ..and you need to add the controls..then you will get those...if not then tell me your task...
0 Kudos
MichaelBreitfeld
New Contributor
Yes, one windows form is ok.
But not realize in my case.
The Main - Application is based on some windows forms.
This new Gis-Application should be integrated in this concept.

Any Ideas, thanks a lot?
0 Kudos
NeilClemmons
Regular Contributor III
You can put the controls on separate forms with no problems.  You will have to set the buddy control property through code instead of through the designer.  For instance, if you have Form1 that contains a map control named AxMapControl1 and Form2 which contains a TOC control named axTocControl1 then this is what the code would look like.

axTOCControl1.SetBuddyControl(Form1.AxMapControl1)

You would need to call this code prior to showing Form2 (like in the form's Load event).
0 Kudos