home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD70856242000.psc / Form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-06-18  |  4.7 KB  |  149 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Drag Component Test"
  4.    ClientHeight    =   3420
  5.    ClientLeft      =   1170
  6.    ClientTop       =   1935
  7.    ClientWidth     =   8820
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   3420
  10.    ScaleWidth      =   8820
  11.    StartUpPosition =   2  'CenterScreen
  12.    Begin VB.ListBox List1 
  13.       BeginProperty Font 
  14.          Name            =   "Verdana"
  15.          Size            =   8.25
  16.          Charset         =   0
  17.          Weight          =   400
  18.          Underline       =   0   'False
  19.          Italic          =   0   'False
  20.          Strikethrough   =   0   'False
  21.       EndProperty
  22.       ForeColor       =   &H00C00000&
  23.       Height          =   2790
  24.       IntegralHeight  =   0   'False
  25.       Left            =   120
  26.       TabIndex        =   2
  27.       Top             =   480
  28.       Width           =   7095
  29.    End
  30.    Begin VB.CommandButton Command2 
  31.       Caption         =   "S&top Draging"
  32.       BeginProperty Font 
  33.          Name            =   "Comic Sans MS"
  34.          Size            =   8.25
  35.          Charset         =   0
  36.          Weight          =   400
  37.          Underline       =   0   'False
  38.          Italic          =   0   'False
  39.          Strikethrough   =   0   'False
  40.       EndProperty
  41.       Height          =   495
  42.       Left            =   7440
  43.       TabIndex        =   1
  44.       Top             =   2760
  45.       Width           =   1215
  46.    End
  47.    Begin VB.CommandButton Command1 
  48.       Caption         =   "&Start Draging"
  49.       BeginProperty Font 
  50.          Name            =   "Comic Sans MS"
  51.          Size            =   8.25
  52.          Charset         =   0
  53.          Weight          =   400
  54.          Underline       =   0   'False
  55.          Italic          =   0   'False
  56.          Strikethrough   =   0   'False
  57.       EndProperty
  58.       Height          =   495
  59.       Left            =   7440
  60.       TabIndex        =   0
  61.       Top             =   480
  62.       Width           =   1215
  63.    End
  64.    Begin VB.Label Label2 
  65.       Caption         =   "Drag any number of files over the ListBox below"
  66.       BeginProperty Font 
  67.          Name            =   "Comic Sans MS"
  68.          Size            =   8.25
  69.          Charset         =   0
  70.          Weight          =   400
  71.          Underline       =   0   'False
  72.          Italic          =   0   'False
  73.          Strikethrough   =   0   'False
  74.       EndProperty
  75.       ForeColor       =   &H00000000&
  76.       Height          =   255
  77.       Left            =   120
  78.       TabIndex        =   4
  79.       Top             =   120
  80.       Width           =   3735
  81.    End
  82.    Begin VB.Label Label1 
  83.       Caption         =   "Component Not Working"
  84.       BeginProperty Font 
  85.          Name            =   "Comic Sans MS"
  86.          Size            =   8.25
  87.          Charset         =   0
  88.          Weight          =   400
  89.          Underline       =   0   'False
  90.          Italic          =   0   'False
  91.          Strikethrough   =   0   'False
  92.       EndProperty
  93.       Height          =   495
  94.       Left            =   7440
  95.       TabIndex        =   3
  96.       Top             =   1440
  97.       Width           =   1215
  98.    End
  99. Attribute VB_Name = "Form1"
  100. Attribute VB_GlobalNameSpace = False
  101. Attribute VB_Creatable = False
  102. Attribute VB_PredeclaredId = True
  103. Attribute VB_Exposed = False
  104. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  105. 'Test Project for the Drag Component.
  106. '                               --- Author, Muhammad Abubakar
  107. '                                       <joehacker@yahoo.com>
  108. '                                       http://go.to/abubakar
  109. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  110. Option Explicit
  111. Private WithEvents iClass As CDrag_Drop
  112. Attribute iClass.VB_VarHelpID = -1
  113. Private size As New CResize
  114. Private Sub Command1_Click()
  115.     iClass.DragHwnd = List1.hWnd
  116.     iClass.StartDrag
  117.     Label1 = "Component Working..."
  118. End Sub
  119. Private Sub Command2_Click()
  120.     iClass.StopDrag
  121.     Label1 = "Component Not Working"
  122. End Sub
  123. Private Sub Form_Load()
  124.     Set iClass = New CDrag_Drop
  125.     With size
  126.         .hParam = Me.Height
  127.         .wParam = Me.Width
  128.         .Map Command1, RS_LeftOnly
  129.         .Map Command2, RS_Top_Left
  130.         .Map Label1, RS_LeftOnly
  131.         .Map List1, RS_Height_Width
  132.     End With
  133. End Sub
  134. Private Sub Form_Resize()
  135.     size.rSize Me
  136. End Sub
  137. Private Sub Form_Unload(Cancel As Integer)
  138.     iClass.StopDrag
  139. End Sub
  140. Private Sub iClass_FilesDroped()
  141.     Dim i As Integer
  142.     List1.Clear
  143.     With iClass
  144.         For i = 0 To .FileCount - 1
  145.             List1.AddItem .FileName(i)
  146.         Next
  147.     End With
  148. End Sub
  149.