Ver Mensaje Individual
  #2  
Antiguo 15-09-2012
Avatar de euler21bv
euler21bv euler21bv is offline
Registrado
 
Registrado: sep 2012
Ubicación: Lima
Posts: 2
Reputación: 0
euler21bv Va por buen camino
Cita:
Empezado por euler21bv Ver Mensaje
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.
lo que quiero es vincular el cuadro de dialogo fontdialog a un shapefile por medio de un botón.
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.
Responder Con Cita