home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / RapidShare2145002242009.psc / RSD / frmList.frm < prev    next >
Text File  |  2009-02-23  |  7KB  |  264 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form frmList 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Schedule List For Downloading..."
  6.    ClientHeight    =   5430
  7.    ClientLeft      =   10560
  8.    ClientTop       =   3705
  9.    ClientWidth     =   6495
  10.    Icon            =   "frmList.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   5430
  15.    ScaleWidth      =   6495
  16.    Begin VB.CommandButton CmdClear 
  17.       Caption         =   "&Clear List"
  18.       Height          =   375
  19.       Left            =   5445
  20.       TabIndex        =   10
  21.       Top             =   1080
  22.       Width           =   975
  23.    End
  24.    Begin VB.CommandButton CmdSave 
  25.       Caption         =   "&Save"
  26.       Height          =   420
  27.       Left            =   5445
  28.       TabIndex        =   8
  29.       Top             =   4455
  30.       Width           =   960
  31.    End
  32.    Begin VB.CommandButton CmdOpen 
  33.       Caption         =   "&Open"
  34.       Height          =   420
  35.       Left            =   5445
  36.       TabIndex        =   7
  37.       Top             =   3960
  38.       Width           =   960
  39.    End
  40.    Begin MSComDlg.CommonDialog CD1 
  41.       Left            =   5715
  42.       Top             =   1620
  43.       _ExtentX        =   847
  44.       _ExtentY        =   847
  45.       _Version        =   393216
  46.    End
  47.    Begin VB.CommandButton CmdListDown 
  48.       Caption         =   "Down"
  49.       Height          =   375
  50.       Left            =   5445
  51.       TabIndex        =   4
  52.       Top             =   2925
  53.       Width           =   960
  54.    End
  55.    Begin VB.CommandButton CmdListUP 
  56.       Caption         =   "Up"
  57.       Height          =   375
  58.       Left            =   5445
  59.       TabIndex        =   3
  60.       Top             =   2430
  61.       Width           =   960
  62.    End
  63.    Begin VB.CommandButton CmdDelete 
  64.       Caption         =   "&Delete"
  65.       Height          =   375
  66.       Left            =   5445
  67.       TabIndex        =   2
  68.       Top             =   585
  69.       Width           =   975
  70.    End
  71.    Begin VB.ListBox List1 
  72.       Height          =   4545
  73.       Left            =   90
  74.       TabIndex        =   6
  75.       Top             =   450
  76.       Width           =   5265
  77.    End
  78.    Begin VB.CommandButton CmdAdd 
  79.       Caption         =   "&Add"
  80.       Height          =   375
  81.       Left            =   5445
  82.       TabIndex        =   1
  83.       Top             =   90
  84.       Width           =   975
  85.    End
  86.    Begin VB.TextBox txtURL 
  87.       Appearance      =   0  'Flat
  88.       Height          =   285
  89.       Left            =   630
  90.       TabIndex        =   0
  91.       Top             =   90
  92.       Width           =   4725
  93.    End
  94.    Begin VB.Label LblTotalFiles 
  95.       Caption         =   "Total Files"
  96.       Height          =   240
  97.       Left            =   135
  98.       TabIndex        =   9
  99.       Top             =   5085
  100.       Width           =   2040
  101.    End
  102.    Begin VB.Label Label1 
  103.       Caption         =   "URL"
  104.       Height          =   255
  105.       Left            =   225
  106.       TabIndex        =   5
  107.       Top             =   120
  108.       Width           =   465
  109.    End
  110. End
  111. Attribute VB_Name = "frmList"
  112. Attribute VB_GlobalNameSpace = False
  113. Attribute VB_Creatable = False
  114. Attribute VB_PredeclaredId = True
  115. Attribute VB_Exposed = False
  116. Dim FileNumber As Long
  117.  
  118. Private Sub CmdAdd_Click()
  119.     If txtURL = "" Then Exit Sub
  120.     If InStr(txtURL.Text, "rapidshare.com") Then
  121.         List1.AddItem txtURL.Text
  122.             On Error Resume Next
  123.             Open App.Path & "\downloads.txt" For Append As #1
  124.                 Print #1, Trim(txtURL.Text)
  125.             Close #1
  126.         txtURL.Text = ""
  127.     Else
  128.         MsgBox "Please Use Only Rapidshare links"
  129.     End If
  130. End Sub
  131.  
  132. Private Sub CmdClear_Click()
  133.     If MsgBox("Are you Sure want to clear the hole lists", vbYesNo) = vbYes Then
  134.         List1.Clear
  135.     End If
  136. End Sub
  137.  
  138. Private Sub CmdDelete_Click()
  139.     If List1.ListIndex = -1 Then Exit Sub
  140.     List1.RemoveItem List1.ListIndex
  141.     Call ChangeListFile
  142.     LblTotalFiles.Caption = "Total Download List " & List1.ListCount
  143. End Sub
  144.  
  145.  
  146. Private Sub CmdListDown_Click()
  147. Dim strTemp As String
  148. Dim Count As Integer
  149.  
  150. Count = List1.ListIndex
  151.  
  152. If Count > -1 Then
  153.     strTemp = List1.List(Count)
  154.     List1.AddItem strTemp, (Count + 2)
  155.     List1.RemoveItem (Count)
  156.     List1.Selected(Count + 1) = True
  157. End If
  158. End Sub
  159.  
  160. Private Sub CmdListUP_Click()
  161. Dim strTemp As String
  162. Dim Count As Integer
  163.  
  164. Count = List1.ListIndex
  165.  
  166. If Count > -1 Then
  167.     strTemp = List1.List(Count)
  168.     List1.AddItem strTemp, (Count - 1)
  169.     List1.RemoveItem (Count + 1)
  170.     List1.Selected(Count - 1) = True
  171. End If
  172. End Sub
  173.  
  174. Private Sub CmdOpen_Click()
  175.     Dim strData As String
  176.     
  177.     CD1.Filter = "Text Files (*.txt)|*.txt|"
  178.     CD1.ShowOpen
  179.     CD1.Flags = &H4
  180.     CD1.CancelError = False
  181.     
  182.     On Error Resume Next
  183.     Open CD1.FileName For Input As #1
  184.         Do While Not EOF(1)
  185.             Line Input #1, strData
  186.             List1.AddItem Trim(strData)
  187.         Loop
  188.     Close #1
  189.     
  190.     Dim i As Integer, intGreatestLen As Integer, lngGreatestWidth As Long
  191.     For i = 0 To List1.ListCount - 1
  192.         If Len(List1.List(i)) > Len(List1.List(intGreatestLen)) Then
  193.             intGreatestLen = i
  194.         End If
  195.     Next i
  196.     lngGreatestWidth = List1.Parent.TextWidth(List1.List(intGreatestLen) + Space(1))
  197.     lngGreatestWidth = lngGreatestWidth \ Screen.TwipsPerPixelX
  198.     SendMessage List1.hwnd, LB_SETHORIZONTALEXTENT, lngGreatestWidth, 0
  199.  
  200.     LblTotalFiles.Caption = "Total Download List " & List1.ListCount
  201. End Sub
  202.  
  203. Private Sub CmdSave_Click()
  204.     Call ChangeListFile
  205. End Sub
  206.  
  207. Sub Form_Load()
  208.     Dim strData As String
  209.     On Error Resume Next
  210.     Open App.Path & "\downloads.txt" For Input As #1
  211.         Do While Not EOF(1)
  212.             Line Input #1, strData
  213.             List1.AddItem Trim(strData)
  214.         Loop
  215.     Close #1
  216.     
  217.     Dim i As Integer, intGreatestLen As Integer, lngGreatestWidth As Long
  218.     For i = 0 To List1.ListCount - 1
  219.         If Len(List1.List(i)) > Len(List1.List(intGreatestLen)) Then
  220.             intGreatestLen = i
  221.         End If
  222.     Next i
  223.     lngGreatestWidth = List1.Parent.TextWidth(List1.List(intGreatestLen) + Space(1))
  224.     lngGreatestWidth = lngGreatestWidth \ Screen.TwipsPerPixelX
  225.     SendMessage List1.hwnd, LB_SETHORIZONTALEXTENT, lngGreatestWidth, 0
  226.  
  227.     LblTotalFiles.Caption = "Total Download List " & List1.ListCount
  228. End Sub
  229.  
  230. Sub ChangeListFile()
  231.     On Error Resume Next
  232.     Open App.Path & "\downloads.txt" For Output As #1
  233.         For i = 0 To List1.ListCount - 1
  234.             Print #1, Trim(List1.List(i))
  235.         Next
  236.     Close #1
  237. End Sub
  238.  
  239. Private Sub List1_Click()
  240.     If List1.SelCount > 1 Then
  241.         CmdListDown.Enabled = False
  242.         CmdListUP.Enabled = False
  243.         Exit Sub
  244.     Else
  245.         CmdListDown.Enabled = True
  246.         CmdListUP.Enabled = True
  247.     End If
  248.     If List1.Selected(0) Then
  249.         CmdListUP.Enabled = False
  250.     Else
  251.         CmdListUP.Enabled = True
  252.     End If
  253.     If List1.Selected(List1.ListCount - 1) Then
  254.         CmdListDown.Enabled = False
  255.     Else
  256.         CmdListDown.Enabled = True
  257.     End If
  258. End Sub
  259.  
  260. Private Sub List1_DblClick()
  261.     txtURL.Text = List1.Text
  262.     frmMain.txtURL = List1.Text
  263. End Sub
  264.