home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / ch_code / ch04 / listdrop / listdrop.frm (.txt) next >
Encoding:
Visual Basic Form  |  1996-04-13  |  4.4 KB  |  127 lines

  1. VERSION 5.00
  2. Begin VB.Form ListDrop 
  3.    Caption         =   "ListDrop"
  4.    ClientHeight    =   4230
  5.    ClientLeft      =   810
  6.    ClientTop       =   2040
  7.    ClientWidth     =   9810
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   4230
  10.    ScaleWidth      =   9810
  11.    Begin VB.ListBox TAPEList 
  12.       Height          =   1425
  13.       Left            =   5085
  14.       TabIndex        =   4
  15.       Top             =   2535
  16.       Width           =   4575
  17.    End
  18.    Begin VB.ListBox TEMPList 
  19.       Height          =   1425
  20.       Left            =   5040
  21.       TabIndex        =   3
  22.       Top             =   465
  23.       Width           =   4635
  24.    End
  25.    Begin VB.FileListBox FileList 
  26.       Height          =   3795
  27.       Left            =   2640
  28.       TabIndex        =   2
  29.       Top             =   195
  30.       Width           =   2295
  31.    End
  32.    Begin VB.DirListBox Dir1 
  33.       Height          =   3465
  34.       Left            =   270
  35.       TabIndex        =   1
  36.       Top             =   570
  37.       Width           =   2220
  38.    End
  39.    Begin VB.DriveListBox Drive1 
  40.       Height          =   315
  41.       Left            =   315
  42.       TabIndex        =   0
  43.       Top             =   180
  44.       Width           =   2190
  45.    End
  46.    Begin VB.Label DragLabel 
  47.       Height          =   225
  48.       Left            =   8235
  49.       TabIndex        =   7
  50.       Top             =   90
  51.       Width           =   1455
  52.    End
  53.    Begin VB.Label Label2 
  54.       Caption         =   "Move to TAPE"
  55.       Height          =   345
  56.       Left            =   5055
  57.       TabIndex        =   6
  58.       Top             =   2250
  59.       Width           =   2040
  60.    End
  61.    Begin VB.Label Label1 
  62.       Caption         =   "Move to TEMP"
  63.       Height          =   300
  64.       Left            =   4995
  65.       TabIndex        =   5
  66.       Top             =   120
  67.       Width           =   2205
  68.    End
  69. Attribute VB_Name = "ListDrop"
  70. Attribute VB_GlobalNameSpace = False
  71. Attribute VB_Creatable = False
  72. Attribute VB_PredeclaredId = True
  73. Attribute VB_Exposed = False
  74. Option Explicit
  75. Private Sub FileList_DragDrop(Source As Control, X As Single, Y As Single)
  76.     If ListDrop.ActiveControl.Name = "TEMPList" And TEMPList.ListIndex > -1 Then
  77.         TEMPList.RemoveItem TEMPList.ListIndex
  78.     ElseIf ListDrop.ActiveControl.Name = "TAPEList" And TAPEList.ListIndex > -1 Then
  79.         TAPEList.RemoveItem TAPEList.ListIndex
  80.     End If
  81. End Sub
  82. Private Sub FileList_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  83. Dim DY As Integer
  84.     DY = TextHeight("A")    ' Height of item
  85.     DragLabel.Move FileList.Left, _
  86.              FileList.Top + Y - DY / 2, FileList.Width, DY
  87.     DragLabel.Drag          ' Drag label instead of item
  88. End Sub
  89. Private Sub Form_Load()
  90.     DragLabel.Visible = 0  ' Make the label invisible.
  91. End Sub
  92. Private Sub Dir1_Change()
  93.     FileList.Path = Dir1.Path
  94. End Sub
  95. Private Sub Drive1_Change()
  96.     ChDrive Drive1.Drive
  97.     Dir1.Path = Drive1.Drive
  98. End Sub
  99. Private Sub TAPEList_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  100. Dim DY
  101.     DY = TextHeight("A")    ' Height of item
  102.     DragLabel.Move TAPEList.Left, _
  103.              TAPEList.Top + Y - DY / 2, TEMPList.Width, DY
  104.     DragLabel.Drag          ' Drag label instead of item
  105. End Sub
  106. Private Sub TEMPList_DragDrop(Source As Control, X As Single, Y As Single)
  107.     If ListDrop.ActiveControl.Name = "FileList" Then TEMPList.AddItem Dir1.Path & "\" & FileList.FileName
  108. End Sub
  109. Private Sub Dir1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
  110.     If State = 0 Then Source.MousePointer = 12
  111.     If State = 1 Then Source.MousePointer = 0
  112. End Sub
  113. Private Sub Drive1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
  114.     If State = 0 Then Source.MousePointer = 12
  115.     If State = 1 Then Source.MousePointer = 0
  116. End Sub
  117. Private Sub TEMPList_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  118. Dim DY As Integer
  119.     DY = TextHeight("A")    ' Height of item
  120.     DragLabel.Move TEMPList.Left, _
  121.              TEMPList.Top + Y - DY / 2, TEMPList.Width, DY
  122.     DragLabel.Drag          ' Drag label instead of item
  123. End Sub
  124. Private Sub TAPEList_DragDrop(Source As Control, X As Single, Y As Single)
  125.     If ListDrop.ActiveControl.Name = "FileList" Then TAPEList.AddItem Dir1.Path & "\" & FileList.FileName
  126. End Sub
  127.