Click here to Skip to main content
15,925,206 members
Home / Discussions / C#
   

C#

 
GeneralRe: Batch script question Pin
Andy Brummer4-Apr-05 9:24
sitebuilderAndy Brummer4-Apr-05 9:24 
GeneralRe: Batch script question Pin
Esmo20005-Apr-05 5:01
Esmo20005-Apr-05 5:01 
GeneralControls and datepicker Pin
xrado4-Apr-05 8:13
xrado4-Apr-05 8:13 
GeneralRe: Controls and datepicker Pin
theoutlander4-Apr-05 18:03
theoutlander4-Apr-05 18:03 
GeneralRe: Controls and datepicker Pin
Luis Alonso Ramos4-Apr-05 18:49
Luis Alonso Ramos4-Apr-05 18:49 
General[C#] Binary Registry Value Pin
RayMarron4-Apr-05 8:12
RayMarron4-Apr-05 8:12 
GeneralRe: [C#] Binary Registry Value Pin
RayMarron4-Apr-05 8:44
RayMarron4-Apr-05 8:44 
GeneralProblem deleting file after loading in imagelist.. Pin
abcxyz824-Apr-05 8:02
abcxyz824-Apr-05 8:02 
Hi all,

My application loads user selected images in Imagelist for thumbnail display in Listview...Here's the code that i use do that..

ImageList.Images.Add(imageToLoad,Image.FromFile(imageToLoad));<br />
LstVwImage.Items.Add(imageToLoad,imageToLoad);	


So far so good, When user selects any image from listview and selects Delete button, I want it to remove items from listview and imagelist and delete physical file corrosponding that path, here's the code I am using...

<br />
LstVwImage.Items.RemoveAt(deleteIndex);<br />
ImageList.Images.RemoveAt(deleteIndex);<br />
FileInfo fi = new FileInfo(deleteFile);<br />
fi.Delete();<br />


Unfortunately its not able to delete file, saying "File is being used by another process"...Its not permission error as I am able to delete any file if its not loaded in imagelist or listview...

Either I'm getting crazy or stupid error!!!

Pls throw some light on this!!

Regards
MaulikCE

"Every obstacle presents an opportunity to improve our condition."
GeneralRe: Problem deleting file after loading in imagelist.. Pin
_eulogy_4-Apr-05 13:27
_eulogy_4-Apr-05 13:27 
GeneralNewbie help: ListView with Dropdown column Pin
b_p_smith4-Apr-05 7:54
b_p_smith4-Apr-05 7:54 
GeneralRe: Newbie help: ListView with Dropdown column Pin
Luis Alonso Ramos4-Apr-05 15:03
Luis Alonso Ramos4-Apr-05 15:03 
GeneralRe: Newbie help: ListView with Dropdown column Pin
b_p_smith4-Apr-05 15:39
b_p_smith4-Apr-05 15:39 
GeneralRe: Newbie help: ListView with Dropdown column Pin
mav.northwind4-Apr-05 20:08
mav.northwind4-Apr-05 20:08 
GeneralRe: Newbie help: ListView with Dropdown column Pin
b_p_smith5-Apr-05 1:49
b_p_smith5-Apr-05 1:49 
GeneralMarshalling MyStruct[] from C# to C++ API Pin
Grimolfr4-Apr-05 7:25
Grimolfr4-Apr-05 7:25 
GeneralRe: Marshalling MyStruct[] from C# to C++ API Pin
Daniel Turini4-Apr-05 8:24
Daniel Turini4-Apr-05 8:24 
Generalreferencing a control on another form Pin
kornstyle4-Apr-05 7:08
kornstyle4-Apr-05 7:08 
GeneralRe: referencing a control on another form Pin
tdciDoug4-Apr-05 7:36
tdciDoug4-Apr-05 7:36 
GeneralRe: referencing a control on another form Pin
Luis Alonso Ramos4-Apr-05 7:53
Luis Alonso Ramos4-Apr-05 7:53 
GeneralRe: referencing a control on another form Pin
kornstyle4-Apr-05 8:26
kornstyle4-Apr-05 8:26 
QuestionWrite a format provider ?? Pin
Ray-v4-Apr-05 5:59
Ray-v4-Apr-05 5:59 
AnswerRe: Write a format provider ?? Pin
Luis Alonso Ramos4-Apr-05 15:07
Luis Alonso Ramos4-Apr-05 15:07 
GeneralWindow State Pin
Finn Grimwood4-Apr-05 5:51
Finn Grimwood4-Apr-05 5:51 
GeneralRe: Window State Pin
Tom Larsen4-Apr-05 10:29
Tom Larsen4-Apr-05 10:29 
GeneralRe: Window State Pin
Finn Grimwood6-Apr-05 2:48
Finn Grimwood6-Apr-05 2:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.