I have a form that contains a listview control. This control is used to display file information, i.e. filename, path, size, etc. Each row of the control is a class (in my case clsFile.cls).
When I double click on an entry in the control it pops up another form where I can edit some of the information. The information was passed from the main form to it by passing a reference to that specific class.
ONce the information is edited and I commit the changes. After commiting the changes I call a refreshLSV sub that refreshes the listview control on the main form, but this doesn't work.
form1:
'lsv is the name of the listview control
private fileList as new collection 'this is loaded with clsFile classes
private sub lsv_dblclick()
for i = 1 to lsv.listitems.count
if lsv.listitems(i).selected then
set myFile = fileList(i)
end if
next i
form2.setFile = myFile 'This is passed by reference
form2.show
end sub
public sub refreshLSV()
dim itmx as listitem
dim myFile as clsFile
lsv.listitems.clear
for each myFile in fileList
set itmx = lsv.listitems.add(,,myFile.getPath)
itmx.subitems(1) = myfile.getName
itmx.subitems(2) = myfile.getSize
next myFile
end sub
form2:
private myFile as clsFile
public property let setFile(byref f as clsFile)
myfile = f
end property
private sub updateChanges()
form1.refreshlsv
unload me
end sub
The code above only includes the components that are causing probelms. What happens, after the update sub is fired on form2, nothing happens on form1, but if I manually click the refresh button on form1, after firing the update sub on form2, which fires the refreshlsv sub on form1
that displays the updates?
any ideas?
Troy Williams B.Eng.
fenris@hotmail.com
When I double click on an entry in the control it pops up another form where I can edit some of the information. The information was passed from the main form to it by passing a reference to that specific class.
ONce the information is edited and I commit the changes. After commiting the changes I call a refreshLSV sub that refreshes the listview control on the main form, but this doesn't work.
form1:
'lsv is the name of the listview control
private fileList as new collection 'this is loaded with clsFile classes
private sub lsv_dblclick()
for i = 1 to lsv.listitems.count
if lsv.listitems(i).selected then
set myFile = fileList(i)
end if
next i
form2.setFile = myFile 'This is passed by reference
form2.show
end sub
public sub refreshLSV()
dim itmx as listitem
dim myFile as clsFile
lsv.listitems.clear
for each myFile in fileList
set itmx = lsv.listitems.add(,,myFile.getPath)
itmx.subitems(1) = myfile.getName
itmx.subitems(2) = myfile.getSize
next myFile
end sub
form2:
private myFile as clsFile
public property let setFile(byref f as clsFile)
myfile = f
end property
private sub updateChanges()
form1.refreshlsv
unload me
end sub
The code above only includes the components that are causing probelms. What happens, after the update sub is fired on form2, nothing happens on form1, but if I manually click the refresh button on form1, after firing the update sub on form2, which fires the refreshlsv sub on form1
that displays the updates?
any ideas?
Troy Williams B.Eng.
fenris@hotmail.com