hi
private void listView1_MouseDown(object sender, MouseEventArgs e)
{
i need to pass fileInfo method to here. but i don't know how should be the argument
fileInfo( ARGUMENT?????)
}
protected void fileInfo(string pathName)
{
ClearAllFields();
FileInfo TheFile = new FileInfo(pathName);
FileAttributes attri = new FileAttributes(pathName);
if (TheFile.Exists)
{
DirectoryInfo Parent = TheFile.Directory;
DisplayFileInfo(TheFile);
return;
}
}
as well i need to change file property summery.....i mean (title, Subject, Author, Catogeory, KeyWords & comments)
how can i read the summery and edit the summery...????
Jan MontanoPosted Feb 26, 2009, 7:29 PM
1. ImageList contains images.
2. However, it does not contain references to the image file. So you'll not be able to use FileInfo.
How are you loading the images in the ImageList? If you are loading it via the GUI control properties, then it would be impossible to retrieve the file path of your images.
3. You need to load the ImageList at run-time so that we'll have reference to the image files.
e.g.
string[] imageLocation = new string[2];
imageLocation[0] = @"C:\BigMac.jpg";
imageLocation[1] = @"C:\CheeseBurger.jpg";
for (int i=0; i
Image image = Image.FromFile(imageLocation[i]);
imageList1.Images.Add(image);
}
Is it still clear?
You must do this before you could do drag-and-drop and display File information.
asela WijesooriyaPosted Feb 26, 2009, 7:40 AM
sure ill send a big mac attached mail to u.....hehehe
actually listview item is image list.......i guess liveview sub items are images in the image list.i think its like that.....bcz whe i load item and check the item i can see subitem count 1..so that should be my images inside that imagelist am i correct?..........
i need drag and drop those selected images from listviewbox A to ListView box b my itemdrag and dragEnter can work but still dragdrop is not working. and as well
other thing is when i click on item in listview i need to display info..i mean when we go to file property there go summery right....so i want to display that all the element.....how can i do that......??? need to edit also......
if u know how to do this just help me.....thx a lot.....
Jan MontanoPosted Feb 25, 2009, 10:20 PM
are you using an imageList to fill up your image in the listView?
You must have references to the file path of your pictures to be able to accomplish this.
asela WijesooriyaPosted Feb 25, 2009, 10:11 PM
actually its containt pictures in list view.....
sorry.don't be angry. i just want to ask some thing bcz im not pro in programming still biggning of biggning....hehehe.....
how about use mousedown event.....bcz i want to show all the file informations in few tex boxes. that mean when i click the image in listview box, in the textboxes need to show info.....
by methos which is u sent to me, can i do that....
????
thank a looooooooooot to your BIG BIG help......thanks JAN
Jan MontanoPosted Feb 25, 2009, 9:16 PM
assuming that the path is on the first column:
private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
if (listView1.SelectedItems.Count > 0)
{
//MessageBox.Show(listView1.SelectedItems[0].Text);
fileInfo(listView1.SelectedItems[0].Text);
}
}