VERSION 5.00
Begin VB.Form frmteachermain 
   Caption         =   "Teacher"
   ClientHeight    =   6540
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   9210
   LinkTopic       =   "Form1"
   ScaleHeight     =   6540
   ScaleWidth      =   9210
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdview 
      Caption         =   "View User"
      Height          =   495
      Left            =   6240
      TabIndex        =   6
      Top             =   2640
      Width           =   2415
   End
   Begin VB.ListBox lstusers 
      Height          =   3960
      ItemData        =   "frmteachermain.frx":0000
      Left            =   600
      List            =   "frmteachermain.frx":0002
      TabIndex        =   5
      Top             =   1080
      Width           =   2775
   End
   Begin VB.CommandButton cmddelete 
      Caption         =   "Delete a user"
      Height          =   495
      Left            =   6240
      TabIndex        =   1
      Top             =   2040
      Width           =   2415
   End
   Begin VB.CommandButton cmdadd 
      Caption         =   "Add a user"
      Height          =   495
      Left            =   6240
      TabIndex        =   0
      Top             =   1320
      Width           =   2415
   End
   Begin VB.Label Label2 
      Height          =   855
      Left            =   6240
      TabIndex        =   8
      Top             =   4440
      Width           =   1695
   End
   Begin VB.Label Label1 
      Height          =   735
      Left            =   4440
      TabIndex        =   7
      Top             =   4440
      Width           =   1095
   End
   Begin VB.Label lbltitletask 
      Caption         =   "Tasks"
      Height          =   495
      Left            =   3720
      TabIndex        =   4
      Top             =   480
      Width           =   2055
   End
   Begin VB.Label lblnametitle 
      Caption         =   "Users"
      Height          =   255
      Left            =   600
      TabIndex        =   3
      Top             =   480
      Width           =   2775
   End
   Begin VB.Label lbltasks 
      BorderStyle     =   1  'Fixed Single
      Height          =   2895
      Left            =   3720
      TabIndex        =   2
      Top             =   1080
      Width           =   2055
   End
End
Attribute VB_Name = "frmteachermain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Option Explicit
Dim myArray() As String
Dim myPwdArray() As String
Private Sub cmdadd_Click()
frmnewuser.Show
frmnewuser.txtfullname.SetFocus
Me.Hide
Unload Me
End Sub

Private Sub cmddelete_Click()
Dim user As Integer
user = lstusers.Selected ???
If user Then

If MsgBox("Please select a user", vbExclamation + vbOKOnly, "Select a user") = vbOK Then

End If
Else
If MsgBox("Are you sure you want to delete this user?", vbYesNo + vbExclamation, "Delete?") = vbYes Then
lstusers.RemoveItem (user)
End If
End If
End Sub

Private Sub cmdview_Click()
'Dim FSys As New FileSystemObject
'Dim textfile As String
'textfile = "H:\IPT\vb prject2013\names.txt"
'Open textfile as
'1FSys.OpenTextFile (textfile,
'Open textfile For Input As #1
'Dim InStream As TextStream
'Dim FSys As FileSystemObject
'Dim TestFile As String
'TestFile = "M:\IPT VB 2013\project\vb prject2013\names.txt"
'Set InStream = FSys.OpenTextFile(TestFile, 1, False, False)
'While InStream.AtEndOfStream = False
  '  TLine = InStream.ReadLine
   ' txt = txt & TLine & cbCrLf
'Wend
'lstusers.Text = "The following text was read from the file" & vbCrLf
'lstusers.Text = lstusers.Text & vbCrLf & String(50, "*")
'lstusers.Text = lstusers.Text & vbCrLf & txt
'lstusers.Text = lstusers.Text & vbCrLf & String(50, "*")
'Set InStream = Nothing


'Dim strItem1 As String
'Dim strItem2 As String
'Dim strItem3 As String'

'Dim i As Integer 'HERERERERERERERER'


'Dim intFile As Integer
'intFile = FreeFile()
'Open "P:\IPT\project\vb prject2013\names.txt" For Input As intFile
'Do Until EOF(intFile)
'Input #intFile, strItem1, strItem2, strItem3
'lbltasks.Caption = strItem1 & " " + strItem2
'lstusers.ListCount
'Loop
'Close intFile

'Open "P:\IPT\project\vb prject2013\names.txt" For Input As intFile
'Do Until EOF(intFile)
'Input #intFile, strItem1, strItem2, strItem3
'lblfullname.Caption = strItem1
'lblusername.Caption = strItem2
'lblpassword.Caption = strItem3
'Loop
'Close intFile
'End If
'End Sub

frmviewuser.Show
Me.Hide



'Dim myArray() As String
'Dim myPwdArray() As String

'Dim intFile As Integer, intfile2 As Integer, x As Integer, y As Integer
'Dim myLine As String
''intFile = FreeFile
'Open "P:\IPT\project\vb prject2013\names.txt" For Input As intFile
  '  Do While Not EOF(1)
  ''      Line Input #1, myLine
  '      y = y + 1
 ''      Loop
 '      ReDim myPwdArray(y) As String
'Close #1
'intfile2 = FreeFile
'Open "P:\IPT\project\vb prject2013\names.txt" For Input As intfile2
   ' Do While Not EOF(1)
     '  Line Input #1, myLine
     '  myArray = Split(myLine, ",")
    '   lstusers.AddItem (myArray(0))
   '    myPwdArray(x) = (myArray(1))
 '      x = x + 1
  '  Loop
'Close #1
End Sub


Private Sub lstusers_Click()
'Dim strItem1 As String
'Dim strItem2 As String
'Dim strItem3 As String '


'Dim intFile As Integer
'intFile = FreeFile()
'Open "P:\IPT\project\vb prject2013\names.txt" For Input As intFile
'Do Until EOF(intFile)
'Input #intFile, strItem1, strItem2, strItem3
'Label1.Caption = strItem1
'Label2.Caption = strItem2
'frmviewuser.lblfullname.Caption = strItem1
'frmviewuser.lblusername.Caption = strItem2
'frmviewuser.lblpassword.Caption = strItem3
'Loop
'Close intFile
Label1.Caption = List1.List(lstusers.ListIndex)
Label2.Caption = myPwdArray(lstusers.ListIndex)
End Sub






Private Sub Form_Load()
'Dim strItem1 As String
'Dim strItem2 As String
'Dim strItem3 As String

'Dim intFile As Integer
'intFile = FreeFile()
'Open "P:\IPT\project\vb prject2013\names.txt" For Input As intFile
'Do Until EOF(intFile)
'Input #intFile, strItem1, strItem2, strItem3
'lstusers.AddItem strItem1
'Loop
'Close intFile



Dim myArray() As String
Dim myPwdArray() As String

Dim intFile As Integer, intfile2 As Integer, x As Integer, y As Integer
Dim myLine As String
intFile = FreeFile
Open "P:\IPT\project\vb prject2013\names.txt" For Input As intFile
    Do While Not EOF(1)
        Line Input #1, myLine
        y = y + 1
       Loop
       ReDim myPwdArray(y) As String
Close #1
intfile2 = FreeFile
Open "P:\IPT\project\vb prject2013\names.txt" For Input As intfile2
    Do While Not EOF(1)
       Line Input #1, myLine
       myArray = Split(myLine, ",")
       lstusers.AddItem (myArray(0))
       myPwdArray(x) = (myArray(1))
       x = x + 1
    Loop
Close #1

End Sub



Private Sub lstusers_DblClick()
'frmviewuser.Show
'Me.Hide
End Sub
