Code for Checkbox and Radio Buttons to open a shapefile

320
3
12-06-2013 07:09 AM
Occasional Contributor III
I am trying to program a check box to open a shapefile. I think the code for the checkbox is "If chkboxstate.text = pApp.OpenDocument (location of shaepfile). Radio button is "If OptButtonATR.text = ........"

Please help!!
Reply
0 Kudos
3 Replies
Occasional Contributor
You would want to put that in the checkbox's CheckChanged Event.  Something like:


private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
   if (checkBox1.Checked == true)
   {
      //Do stuff to open shapefile
   }
}
Reply
0 Kudos
Occasional Contributor III
I also started this code. Am I headed in the right direction or no!!
Dim openFileDialog As SystemFont.Windows.Forms.openFileDialog
       

    If chkState.Enabled Then
        If radAtr.Enabled Then openFileDialog.InitialDirectory = "K:\"
    End If
Reply
0 Kudos
New Contributor
Are you trying to pull the shapefile into a map? As in, open it as a layer?
Reply
0 Kudos