![]() |
Como Crear Etiquetas Con Mapobjects Y Vb.net 2008
Hola a todos, pues soy nuevo en este foro , pero quisiera saber como poner etiquetas a una capa .shapefile con un botón y un cuadro de dialogo fontdialog,por favor ayudadme... de antemano muchas gracias.
|
Cita:
bueno aca les dejo todo el codigo,es lo que hasta ahora tengo,pero por favor alguien que me ayude a completarlo segun mi solicitud anterior...muchas gracias... Imports System.Runtime.InteropServices Imports ESRI.MapObjects2.Core Public Class Form1 Dim mp_layer As MapLayer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnabrir.Click OFd_shp.Filter = "Mis Archivos shp|*.shp|archivosdbf|*.dbf" OFd_shp.ShowDialog() Dim archivo As String archivo = OFd_shp.FileName If archivo <> "" Then Dim pos As Integer = archivo.LastIndexOf("\") INICIAMAPA(archivo.Substring(0, pos), archivo.Substring(pos + 1)) vistacompleta() End If End Sub Private Sub INICIAMAPA(ByVal datapath As String, ByVal file As String) Try Dim dc As DataConnection = New DataConnectionClass Dim path As String = datapath dc.Database = path dc.Connect() mp_layer = New MapLayerClass Dim gds As GeoDataset = dc.FindGeoDataset(file) mp_layer.GeoDataset = gds AxMap1.Layers.Add(mp_layer) AxMap2.Layers.Add(mp_layer) Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub Private Sub vistacompleta() AxMap1.Extent = AxMap1.FullExtent AxMap2.Extent = AxMap1.FullExtent End Sub Private Sub AxMap1_KeyDownEvent(ByVal sender As Object, ByVal e As ESRI.MapObjects2.Core.KeyDownEventArgs) Handles AxMap1.KeyDownEvent Try If e.keyCode = 123 Then vistacompleta() End If Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub Private Sub zoom_move(ByVal sender As System.Object, ByVal e As ESRI.MapObjects2.Core.MouseDownEventArgs) Handles AxMap1.MouseDownEvent 'evento que permite maximizar al hacer clic Try Dim Rect As Rectangle If e.button = 1 Then System.Windows.Forms.Cursor.Current = Cursors.SizeAll 'cursor cuatro flechas Rect = AxMap1.TrackRectangle If Not Rect Is Nothing Then AxMap1.Extent = Rect End If Else System.Windows.Forms.Cursor.Current = Cursors.Hand AxMap1.Pan() End If Catch ex As Exception Finally System.Windows.Forms.Cursor.Current = Cursors.Default End Try End Sub Private Sub Etiquetas(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_label.Click Try Dim pfont As New stdole.StdFont '1) With pfont .Name = "times" .Bold = False .Italic = False .Underline = True .Size = 12 '_______________________________>las propiedades son de tipo estatico End With Dim plabel As New LabelRenderer With plabel '9) .Symbol(0).Height = tkb_etiquetas.Value .Symbol(0).Font = pfont .Field = "NOMBDEP" .AllowDuplicates = True End With mp_layer.Renderer = plabel AxMap1.CtlRefresh() Catch ex As Exception End Try End Sub Private Sub tkb_etiquetas_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tkb_etiquetas.Scroll Etiquetas(sender, e) End Sub Private Sub btntipoletra_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btntipoletra.Click FD_tipoletra.ShowDialog() End Sub End Class donde dice que las propiedades son de tipo estático, pues lo que quiero es independizar esas propiedades..gracias. |
Bienvenido a clubdelphi, ¿ya leiste nuestra guía de estilo?, gracias por tu colaboración :)
Recuerda poner los tags al código fuente, ejemplo: ![]() Gracias :) |
La franja horaria es GMT +2. Ahora son las 07:53:26. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi