簡體   English   中英

GMAP 控件“.NET 不是‘GMapControl’的成員”

[英]GMAP Control ".NET is not a member of 'GMapControl'"

我在嘗試使用 GmapControl package 運行我的應用程序時遇到解決方案錯誤。刪除有錯誤的行似乎不會以任何方式影響應用程序但允許我運行應用程序,調試一段時間后不久,這些行重新出現在designer.vb 文件並返回錯誤。

Me.GMap.Bearing = 0!
Me.GMap.CanDragMap = True
Me.GMap.Dock = System.Windows.Forms.DockStyle.Fill
Me.GMap.EmptyTileColor = System.Drawing.Color.Navy
Me.GMap.GrayScaleMode = False
Me.GMap.HelperLineOption = GMap.NET.WindowsForms.HelperLineOptions.DontShow 'Error Line
Me.GMap.LevelsKeepInMemory = 5
Me.GMap.Location = New System.Drawing.Point(3, 3)
Me.GMap.MarkersEnabled = True
Me.GMap.MaxZoom = 2
Me.GMap.MinZoom = 2
Me.GMap.MouseWheelZoomEnabled = True
Me.GMap.MouseWheelZoomType = GMap.NET.MouseWheelZoomType.MousePositionAndCenter 'Error Line
Me.GMap.Name = "GMap"
Me.GMap.NegativeMode = False
Me.GMap.PolygonsEnabled = True
Me.GMap.RetryLoadTile = 0
Me.GMap.RoutesEnabled = True
Me.GMap.ScaleMode = GMap.NET.WindowsForms.ScaleModes.[Integer] 'Error Line
Me.GMap.SelectedAreaFillColor = System.Drawing.Color.FromArgb(CType(CType(33, Byte), Integer), CType(CType(65, Byte), Integer), CType(CType(105, Byte), Integer), CType(CType(225, Byte), Integer))
Me.GMap.ShowTileGridLines = False
Me.GMap.Size = New System.Drawing.Size(658, 455)
Me.GMap.TabIndex = 1
Me.GMap.Zoom = 0R

問題是名稱沖突。 GMap是一個命名空間,它是.NET的成員,但您還添加了一個名為GMapControlGMap ,因此編譯器將其解釋為該名稱。 請注意這些行的左側都有Me.GMap嗎? 右側帶有GMap的那些被解釋為引用相同的GMapControl而不是適當的名稱空間。 如果更改控件的名稱,則問題將 go 消失。

您可能需要先刪除這些行或之后手動編輯它們,因為重命名也可能會更改命名空間的名稱。

這是為什么對您的控件和其他名稱進行一些思考很重要的示例。 如果您使用的名稱在您的特定場景中具有描述性,則名稱沖突的可能性較小。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM