VERSION 5.00 Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX" Begin VB.Form frmLstPSI BorderStyle = 5 'Sizable ToolWindow Caption = "PSIs" ClientHeight = 4560 ClientLeft = 60 ClientTop = 300 ClientWidth = 2550 Icon = "LstPSIs.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False MDIChild = -1 'True MinButton = 0 'False ScaleHeight = 4560 ScaleWidth = 2550 ShowInTaskbar = 0 'False Begin MSComctlLib.ListView lstPSI DragIcon = "LstPSIs.frx":0E42 Height = 4215 Left = 0 TabIndex = 0 Top = 60 Width = 2535 _ExtentX = 4471 _ExtentY = 7435 View = 3 LabelEdit = 1 LabelWrap = -1 'True HideSelection = -1 'True _Version = 393217 ForeColor = -2147483640 BackColor = -2147483643 BorderStyle = 1 Appearance = 1 NumItems = 1 BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} Text = "Localidad" Object.Width = 3881 EndProperty End Begin VB.Label lblInfo Caption = "Arrastra el PSI sobre la localidad" ForeColor = &H00800000& Height = 255 Left = 0 TabIndex = 1 Top = 4320 Width = 2535 End End Attribute VB_Name = "frmLstPSI" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Dim bPulsado As Boolean ' para drag&drop Private Sub Form_Load() bPulsado = False Me.Width = 2670 Me.Height = 4920 ActualizarListaPSI End Sub Public Sub ActualizarListaPSI() Dim i As Long lstPSI.ListItems.Clear If Not bHayPSI Then Exit Sub End If For i = 0 To UBound(PSIs) lstPSI.ListItems.Add i + 1, "P" & CStr(i), PSIs(i).Nombre & " " & PSIs(i).Adjetivo Next End Sub Private Sub Form_Resize() On Error Resume Next lblInfo.Top = Me.ScaleHeight - lblInfo.Height lblInfo.Left = 0 lstPSI.Top = 60 lstPSI.Left = 0 lstPSI.Width = Me.ScaleWidth lstPSI.Height = Me.ScaleHeight - lblInfo.Height - 120 lstPSI.ColumnHeaders(1).Width = lstPSI.Width - 300 End Sub Private Sub lstPSI_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader) If ColumnHeader.index = 1 Then If lstPSI.Sorted Then lstPSI.Sorted = False ActualizarListaPSI Else lstPSI.SortKey = 0 lstPSI.Sorted = True End If End If End Sub Private Sub lstPSI_DblClick() Dim lPSI As Long ' coge el PSI que está seleccionado If lstPSI.ListItems.Count < 1 Then Exit Sub End If lPSI = CLng(Mid(lstPSI.SelectedItem.Key, 2)) '''JSJ::: End Sub Private Sub lstPSI_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) bPulsado = True End Sub Private Sub lstPSI_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If bPulsado Then bPulsado = False lstPSI.Drag vbBeginDrag End If End Sub Private Sub lstPSI_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) bPulsado = False lstPSI.Drag vbEndDrag End Sub