hello
for your imformation im using Vb6 and having difficulties on loading a file and then displayed the file. for your information i uses a combox,listview ,directory view and also command buttons for my program.i am having the difficulities on loading the data using my load button and than display the data.if i want to load an excel data and then display the data, how shoule i program it.pls help me.
Private Sub cboPattern_Change()
Dim pos1 As Integer
Dim pos2 As Integer
Dim txt As String
txt = cboPattern.Text
pos1 = InStrRev(txt, "(")
pos2 = InStrRev(txt, ")")
filList.Pattern = Mid$(txt, pos1 + 1, pos2 - pos1 - 1)
End Sub
Private Sub cmdCancel_Click()
Me.Hide
End Sub
Private Sub cmdOk_Click()
' We did not cancel.
Canceled = False
FilePath = filList.Path
FileName = filList.FileName
End Sub
Private Sub dirList_Change()
filList.Path = dirList.Path
End Sub
Private Sub drvList_Change()
'On Error GoTo DriveError
dirList.Path = drvList.Drive
Exit Sub
DriveError:
drvList.Drive = dirList.Path
Exit Sub
End Sub
Private Sub Form_Load()
' Assume we will cancel.
Canceled = True
FileName = ""
FilePath = ""
cboPattern.AddItem "All Files (*.*)"
cboPattern.AddItem "Text Files (*.txt)"
cboPattern.AddItem "Excel Files (*.xls)"
cboPattern.AddItem "Bitmap Files (*.bmp)"
cboPattern.AddItem "VB Files (*.frm;*.frx;*.vbp;*.vbw)"
cboPattern.ListIndex = 0
End Sub