Beginners question: how to catch the shapes filename...

Sep 3, 2012 at 10:18 PM

Hello reader...

I am using this simple code to add a layer, a shapefile.... when i press the menuitem a dialog box opens... and i can select the file and its added to my map.... 

But... how do i get that filename i have selected in the dialog box into a variable for further use... for example being printed in a text box...

Private Sub AddLayerToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddLayerToolStripMenuItem.Click       

myVenster.AddLayer()   

End Sub

Thanx in advance, Joska

Sep 4, 2012 at 10:11 AM

IMapLayer  layer=myVenster.AddLayer() ;

FeatrueSet fs=layer.dataset as FeatureSet;

string filename =fs.filename;

Sep 4, 2012 at 7:53 PM

Thanks, it worked...when converted to VB  

I really feel a beginner as jumping from vb6 into vb.net and dotspatial in one jump

Thanks again Izz...!