Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.2 KiB

  1. VERSION 5.00
  2. Begin VB.Form frmChooseDrive
  3. Caption = "Form1"
  4. ClientHeight = 2850
  5. ClientLeft = 60
  6. ClientTop = 345
  7. ClientWidth = 2100
  8. LinkTopic = "Form1"
  9. ScaleHeight = 2850
  10. ScaleWidth = 2100
  11. StartUpPosition = 2 'CenterScreen
  12. Begin VB.CommandButton btnCancel
  13. Cancel = -1 'True
  14. Caption = "Cancel"
  15. Height = 375
  16. Left = 1103
  17. TabIndex = 3
  18. Top = 2280
  19. Width = 855
  20. End
  21. Begin VB.CommandButton btnOK
  22. Caption = "OK"
  23. Default = -1 'True
  24. Height = 375
  25. Left = 143
  26. TabIndex = 2
  27. Top = 2280
  28. Width = 735
  29. End
  30. Begin VB.ListBox lbDrives
  31. Height = 1815
  32. Left = 1320
  33. TabIndex = 1
  34. Top = 240
  35. Width = 495
  36. End
  37. Begin VB.Label Label1
  38. Caption = "Choose a drive:"
  39. Height = 375
  40. Left = 240
  41. TabIndex = 0
  42. Top = 240
  43. Width = 855
  44. End
  45. End
  46. Attribute VB_Name = "frmChooseDrive"
  47. Attribute VB_GlobalNameSpace = False
  48. Attribute VB_Creatable = False
  49. Attribute VB_PredeclaredId = True
  50. Attribute VB_Exposed = False
  51. Option Explicit
  52. Dim m_DriveNames() As String
  53. Dim m_DriveChosen As Integer
  54. Dim m_fOK As Boolean
  55. Public Sub SetDriveNames(ByRef Names() As String, ByVal Selected As Integer)
  56. Dim i As Integer
  57. m_DriveNames = Names
  58. For i = LBound(m_DriveNames) To UBound(m_DriveNames)
  59. lbDrives.AddItem m_DriveNames(i)
  60. Next i
  61. lbDrives.ListIndex = Selected - 1
  62. End Sub
  63. Public Property Get OK() As Boolean
  64. OK = m_fOK
  65. End Property
  66. Private Sub btnCancel_Click()
  67. m_fOK = False
  68. Me.Hide
  69. End Sub
  70. Private Sub btnOK_Click()
  71. m_fOK = True
  72. m_DriveChosen = lbDrives.ListIndex + 1
  73. Me.Hide
  74. End Sub
  75. Private Sub Form_Activate()
  76. m_fOK = False
  77. End Sub
  78. Public Property Get DriveChosen() As Integer
  79. DriveChosen = m_DriveChosen
  80. End Property
  81. Private Sub lbDrives_DblClick()
  82. btnOK_Click
  83. End Sub