Interesante web que transforma el codigo visual basic, c#, python y ruby a cualquiera de dichos lenguajes entre ellos
http://www.developerfusion.com/tools/convert/vb-to-csharp/
14 feb 2011
Suscribirse a:
Enviar comentarios (Atom)
Apuntes de programación y trucos de internet
Dim openFD As New OpenFileDialog()
ResponderEliminarWith openFD
.Title = "Seleccionar archivos"
.Filter = "Todos los archivos (*.xlsx)|*.xlsx"
.Multiselect = False
.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments
If .ShowDialog = Windows.Forms.DialogResult.OK Then
TextPathExcel.Text = .FileName
End If
End With
Dim pDoc As IMxDocument
ResponderEliminarDim pMap As IMap
Set pDoc = ThisDocument
Set pMap = pDoc.FocusMap
' Get the first layer in the table on contents
Dim pFeatLayer As IFeatureLayer
Dim pDispTable As IDisplayTable
Dim pFCLayer As IFeatureClass
Dim pTLayer As ITable
If pMap.LayerCount = 0 Then
MsgBox "Must have at least one layer"
Exit Sub
End If
Set pFeatLayer = pMap.Layer(0)
Set pDispTable = pFeatLayer
Set pFCLayer = pDispTable.DisplayTable
Set pTLayer = pFCLayer
' Get the first table in the table on contents
Dim pTabCollection As IStandaloneTableCollection
Dim pStTable As IStandaloneTable
Dim pDispTable2 As IDisplayTable
Dim pTTable As ITable
Set pTabCollection = pMap
If pTabCollection.StandaloneTableCount = 0 Then
MsgBox "Must have atleast one table"
Exit Sub
End If
Set pStTable = pTabCollection.StandaloneTable(0)
Set pDispTable2 = pStTable
Set pTTable = pDispTable2.DisplayTable
' Create virtual relate
Dim pMemRelFact As IMemoryRelationshipClassFactory
Dim pRelClass As IRelationshipClass
Set pMemRelFact = New MemoryRelationshipClassFactory
Dim strJoiningFieldinTable As String
Dim strJoiningFIeldinFeatureClass As String
strJoiningFieldinTable = "inty"
strJoiningFIeldinFeatureClass = "Fid"
Set pRelClass = pMemRelFact.Open("TabletoLayer", pTTable, strJoiningFieldinTable, pTLayer, _
strJoiningFIeldinFeatureClass, "forward", "backward", esriRelCardinalityOneToOne)
' use Relate to perform a join
Dim pDispRC As IDisplayRelationshipClass
Set pDispRC = pFeatLayer
pDispRC.DisplayRelationshipClass pRelClass, esriLeftOuterJoin
MsgBox ("done")
Exit Sub
Dim i As Integer
ResponderEliminarDim X As Integer
Dim Sbuscar As String
If Grillafacul.RowCount < 1 Then
MsgBox("No hay información en la tabla para buscar", MsgBoxStyle.Information, "Sin información")
End If
If Ocodigo.Checked = True Then
For i = 0 To Grillafacul.RowCount - 1
Sbuscar = Grillafacul.Item(0, i).Value
X = InStr(CShort("1"), Sbuscar, Trim(Tbuscar.Text))
If X <> 0 Then
'GLinea.Item(GLinea.CurrentCell.ColumnIndex, GLinea.CurrentCell.RowIndex).Selected = True
Grillafacul.Item(1, i).Selected = True
Grillafacul.FirstDisplayedCell = Grillafacul.Item(0, i)
Exit Sub
End If
Next
End If
If Onombre.Checked = True Then
For i = 0 To Grillafacul.RowCount - 1
Sbuscar = Grillafacul.Item(1, i).Value
X = InStr(CShort("1"), Sbuscar, Trim(Tbuscar.Text))
If X <> 0 Then
Grillafacul.Item(1, i).Selected = True
Grillafacul.FirstDisplayedCell = Grillafacul.Item(1, i)
Exit Sub
End If
Next
End If