# Need help with MapWinGIS (5.3) in vb.NET (VS2017)

**URL:** <https://mapwindow.discourse.group/t/need-help-with-mapwingis-5-3-in-vb-net-vs2017/1806>\
**Category:** MapWinGIS\
**Created:** [December 12, 2024, 8:26pm UTC](https://mapwindow.discourse.group/t/need-help-with-mapwingis-5-3-in-vb-net-vs2017/1806 "2024-12-12T20:26:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![schufti](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@schufti](https://mapwindow.discourse.group/u/schufti)\
**Post date:** [December 12, 2024, 8:26pm UTC](https://mapwindow.discourse.group/t/need-help-with-mapwingis-5-3-in-vb-net-vs2017/1806/1 "2024-12-12T20:26:49Z")

</div>

Hi there,  
I have basics of my wanted functionality running but now I am stuck with following problems:

1. there is some “autoZoom” when adding a new layer that I want to get rid as there is .ZoomToLayer() if needed
2. somehow I get “0” as layerHandle for every layer I add. At the moment I first load a .shp from file, then some polygons from database, followed by a point from given coordinates; all returning with 0 for layerHandle on addLayer().

please advise

---

<div class="post-metadata">

**Author:** ![schufti](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@schufti](https://mapwindow.discourse.group/u/schufti)\
**Post date:** [December 14, 2024, 11:17am UTC](https://mapwindow.discourse.group/t/need-help-with-mapwingis-5-3-in-vb-net-vs2017/1806/2 "2024-12-14T11:17:53Z")

</div>

once I sorted out my problems with “LayerHandle” variables, problems were solved.  
caveat: initialize your (public/global) LayerHandle variables to -1 if not using like  
_Dim LayerHandle as integer = AxMap1.addLayer()_
