home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / nvlexp / pathfrm.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-12-05  |  2.5 KB  |  87 lines

  1. VERSION 2.00
  2. Begin Form PathFrm 
  3.    Caption         =   "Add Network Path"
  4.    ClientHeight    =   3120
  5.    ClientLeft      =   105
  6.    ClientTop       =   675
  7.    ClientWidth     =   7365
  8.    Height          =   3525
  9.    Left            =   45
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   3120
  13.    ScaleWidth      =   7365
  14.    Top             =   330
  15.    Width           =   7485
  16.    Begin CommandButton Command2 
  17.       Caption         =   "Abort"
  18.       Height          =   495
  19.       Left            =   1950
  20.       TabIndex        =   2
  21.       Top             =   2460
  22.       Width           =   1215
  23.    End
  24.    Begin CommandButton Command1 
  25.       Caption         =   "OK"
  26.       Height          =   495
  27.       Left            =   330
  28.       TabIndex        =   1
  29.       Top             =   2460
  30.       Width           =   1215
  31.    End
  32.    Begin ListBox List1 
  33.       Height          =   1005
  34.       Left            =   2070
  35.       TabIndex        =   3
  36.       Top             =   1140
  37.       Width           =   825
  38.    End
  39.    Begin TextBox Text1 
  40.       Height          =   315
  41.       Left            =   2070
  42.       TabIndex        =   0
  43.       Top             =   420
  44.       Width           =   4935
  45.    End
  46. DefInt A-Z
  47. Sub Command1_Click ()
  48.     Abort% = False
  49.     If PathFrm.List1.ListIndex = -1 Then
  50.         Txt$ = "You must first select a drive!"
  51.         MsgBox Txt$, 32, "Must Pick a Drive"
  52.         Exit Sub
  53.     End If
  54.     If Text1.Text = "" Then
  55.         Txt$ = "You must at least give the volume "
  56.         Txt$ = Txt$ + "label, as in SYS:"
  57.         MsgBox Txt$, 32, "Must Enter Text"
  58.         Exit Sub
  59.     End If
  60.     TmpDrive$ = PathFrm.List1.List(List1.ListIndex)
  61.     Map_Drv.Hidden1.Text = TmpDrive$
  62.     Map_Drv.Hidden2.Text = Text1.Text
  63.     Unload PathFrm
  64. End Sub
  65. Sub Command2_Click ()
  66.     Abort% = True
  67.     Unload PathFrm
  68. End Sub
  69. Sub Form_Load ()
  70. '   Load only the drives that aren't mapped yet!
  71.     For i% = 1 To 26
  72.         If Len(ArrayUnMap$(i%)) > 0 Then
  73.             PathFrm.List1.AddItem ArrayUnMap$(i%)
  74.         End If
  75.     Next i%
  76. End Sub
  77. Sub Form_Paint ()
  78.     TmpTxt$ = "Please enter the path:  "
  79.     PathFrm.CurrentX = PathFrm.Text1.Left - TextWidth(TmpTxt$)
  80.     PathFrm.CurrentY = PathFrm.Text1.Top + 20
  81.     PathFrm.Print TmpTxt$
  82.     TmpTxt$ = "Please Pick a drive:  "
  83.     PathFrm.CurrentX = PathFrm.List1.Left - TextWidth(TmpTxt$)
  84.     PathFrm.CurrentY = PathFrm.List1.Top + 20
  85.     PathFrm.Print TmpTxt$
  86. End Sub
  87.