1
我開始使用Gmaps C#和我注意到,有時,當我在調試模式下運行程序,我退出了,仍然有繼續運行一些GMAP線程(我假設這是發生了什麼),所以程序沒有完成執行,我需要按停止調試。我真的不希望在程序結束後這會繼續發生。某些線程不與GMAP停止時,我關閉應用程序
那麼,有沒有辦法迫使線程的GMapControl內關閉或別的東西怎麼回事?
public class GoogleMap : GMapControl
{
public GoogleMap() : base()
{
this.MapProvider = GMapProviders.GoogleMap;
this.Position = new PointLatLng(46.6682870738831, 15.9823608398438);
this.MinZoom = 1;
this.MaxZoom = 17;
this.Zoom = 9;
this.Location = new Point(0, 24);
this.DragButton = MouseButtons.Left;
originalWidth = Obj.mainForm.ClientRectangle.Width;
originalHeight = Obj.mainForm.ClientRectangle.Height;
this.Dock = DockStyle.Fill;
}
}
這是我使用的構造函數,然後我剛纔添加的GoogleMap對象,以我的主要形式
GoogleMap map = new GoogleMap();
this.Controls.Add(map);
Haven't使用GMAP自己,但似乎你沒有正確配置資源。 GoogleMap類是否實現了IDisposable模式? – steavy 2014-10-02 10:54:32
是的,我嘗試使用.Dispose()它仍然繼續發生 – Vajura 2014-10-02 10:57:44