Click here to Skip to main content
15,915,508 members
Home / Discussions / C#
   

C#

 
GeneralRe: ShellExecute ? Pin
James T. Johnson20-Apr-02 16:45
James T. Johnson20-Apr-02 16:45 
GeneralRe: ShellExecute ? Pin
Neil Van Note20-Apr-02 19:45
Neil Van Note20-Apr-02 19:45 
GeneralRe: ShellExecute ? Pin
Christian Graus21-Apr-02 10:51
protectorChristian Graus21-Apr-02 10:51 
GeneralRe: ShellExecute ? Pin
Neil Van Note21-Apr-02 11:00
Neil Van Note21-Apr-02 11:00 
GeneralRe: ShellExecute ? Pin
James T. Johnson21-Apr-02 11:31
James T. Johnson21-Apr-02 11:31 
GeneralRe: ShellExecute ? Pin
Christian Graus21-Apr-02 11:36
protectorChristian Graus21-Apr-02 11:36 
GeneralRe: ShellExecute ? Pin
James T. Johnson21-Apr-02 11:54
James T. Johnson21-Apr-02 11:54 
GeneralListView.Items.Contains() problem... Pin
20-Apr-02 15:18
suss20-Apr-02 15:18 
I'm a newbie when it comes to C# and I was wondering if someone can help me with it. Has anyone successfully use the ListView.Items.Contains method? It does not work for me at all (always returns a "true" no matter what the data).

here's an example code of what I did:
//----------------------------------------------
string FilePath = @"C:\SomeFolder\SomeFile.txt";
FileInfo FI = new FileInfo(FilePath);
string[] fileInfo = {FI.Name,FI.DirectoryName};
ListViewItem myListItem = new ListViewItem(fileInfo,0);
if(lvMain.Items.Contains(myListItem) == false && tFI.Attributes != FileAttributes.Directory)
{
listView1.Items.Add(myListItem);
}
//----------------------------------------------

It works fine the first run, but if I run the code again with the same FilePath info it still adds the myListItem onto the listView1, resulting in redundant entry in my ListView control...

please someone help me get this Contains method to work! TIA Smile | :)
Generaloops... Pin
20-Apr-02 15:20
suss20-Apr-02 15:20 
GeneralRe: oops... Pin
20-Apr-02 15:28
suss20-Apr-02 15:28 
GeneralRe: oops... Pin
Neil Van Note20-Apr-02 19:37
Neil Van Note20-Apr-02 19:37 
GeneralRe: oops... Pin
20-Apr-02 22:54
suss20-Apr-02 22:54 
GeneralMulti monitors Pin
Christian Graus20-Apr-02 14:59
protectorChristian Graus20-Apr-02 14:59 
GeneralRe: Multi monitors Pin
Paul M Watt20-Apr-02 15:39
mentorPaul M Watt20-Apr-02 15:39 
GeneralRe: Multi monitors Pin
Christian Graus20-Apr-02 15:58
protectorChristian Graus20-Apr-02 15:58 
GeneralRe: Multi monitors Pin
Paul M Watt20-Apr-02 17:03
mentorPaul M Watt20-Apr-02 17:03 
GeneralRe: Multi monitors Pin
Christian Graus20-Apr-02 17:36
protectorChristian Graus20-Apr-02 17:36 
GeneralRe: Multi monitors Pin
Christian Graus21-Apr-02 10:52
protectorChristian Graus21-Apr-02 10:52 
GeneralRe: Multi monitors Pin
Paul M Watt21-Apr-02 12:07
mentorPaul M Watt21-Apr-02 12:07 
QuestionNumber only edit boxes ??? Pin
Christian Graus20-Apr-02 11:12
protectorChristian Graus20-Apr-02 11:12 
AnswerRe: Number only edit boxes ??? Pin
James T. Johnson20-Apr-02 12:20
James T. Johnson20-Apr-02 12:20 
GeneralRe: Number only edit boxes ??? Pin
Christian Graus20-Apr-02 12:26
protectorChristian Graus20-Apr-02 12:26 
GeneralRe: Number only edit boxes ??? Pin
James T. Johnson20-Apr-02 12:44
James T. Johnson20-Apr-02 12:44 
GeneralRe: Number only edit boxes ??? Pin
Neil Van Note20-Apr-02 19:06
Neil Van Note20-Apr-02 19:06 
GeneralRe: Number only edit boxes ??? Pin
Mazdak20-Apr-02 19:08
Mazdak20-Apr-02 19:08 

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.