Code for Checkbox and Radio Buttons to open a shapefile

525
3
12-06-2013 07:09 AM
MichelleCouden1
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!!
0 Kudos
3 Replies
JohnStephens
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
   }
}
0 Kudos
MichelleCouden1
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
0 Kudos
GraceCai
New Contributor
Are you trying to pull the shapefile into a map? As in, open it as a layer?
0 Kudos