How to show the add data dialog box?

2937
2
07-17-2010 01:30 PM
Chandan_KumarRath
New Contributor
I am using C#.NET 2008 with ArcEngine9.3 and ArcGIS Desktop 9.3. I want to use the Add Data dialog box to add layers (.shp, .lyr, etc..) to a desktop application. Which command i have to use to show the dialog box (Add Data dialog box in ArcMap).

Thanks in advance.....
0 Kudos
2 Replies
DougMarquardt
New Contributor
I use my own toolbars (can't stand the esri toolbars - they don't scroll buttons like a normal windows toolbar): here is an example of what I do (works for me!):

    Private Sub tsbAddData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbAddData.Click
        Try
            Dim pCommand As ICommand = New ESRI.ArcGIS.Controls.ControlsAddDataCommand
            pCommand.OnCreate(AxMapControl1.Object)
            pCommand.OnClick()
        Catch ex As Exception
            MessageBox.Show(Me, ex.Message)
        End Try
    End Sub

Hope this helps.

Doug.
0 Kudos
Chandan_KumarRath
New Contributor
You are great Doug...
It works...

Thank you very much..
0 Kudos