Select to view content in your preferred language

How to make an existing C# application to work inside ArcMap

788
4
06-17-2013 02:58 AM
Chriz_
by
New Contributor
Hello all,

I'm just getting started with ArcObjects and I could use some help.
I found some great tutorials and examples about building add-ins, but I am wondering if I can customize an existing windows-based application to work inside ArcMap.

Here's a more detailed description of what i need to do.

I already have a windows-based application with forms written on C# that connects to SQL Server and insert/edit/delete data through stored procedures.
These records are related to polygons through the same ID.

What I need, is to make these forms run inside ArcMap 10.1, in order to save time for the user.
For example when a user clicks on the polygon, a form with data(for that specific ID) will be returned.

What's the best way of doing this?

Thank you in advance.
0 Kudos
4 Replies
Chriz_
by
New Contributor
Thanks for the link, I'll look it up.
0 Kudos
JosephArmbruster
New Contributor III
Chriz,

You could create a User control for your form by coming off of UserControl and IDockableWindowDef.  Then you can create a Command and during OnCreate use the IDockableWindowManager interface of your application object to create a new window.  This will embed the control within ArcMap and make it behave like the TOC or any other dockable control 🙂  Try it out:

// your new dockable control
[Guid("YOUR_GUID")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("YOUR_PROG_ID")]
public class PluginWindow : UserControl, IDockableWindowDef
{
    // blah blah...
}


// what do to in oncreate for your command
IDockableWindowManager manager = application as IDockableWindowManager;

UID window_uid = new UIDClass();
window_uid.Value = YOUR_NEW_CONTROLS_GUID;
_dockable_window = manager.GetDockableWindow(window_uid);
_dockable_window.Dock(esriDockFlags.esriDockRight);

// private member in you command
IDockableWindow _dockable_window;
0 Kudos
Chriz_
by
New Contributor
Thanks Joseph, this is pretty useful 🙂
0 Kudos