Click here to Skip to main content
15,917,174 members
Home / Discussions / C#
   

C#

 
QuestionC# Registry Change Event Pin
Michael Fritzius6-Feb-09 12:07
professionalMichael Fritzius6-Feb-09 12:07 
AnswerRe: C# Registry Change Event Pin
Christian Graus6-Feb-09 12:42
protectorChristian Graus6-Feb-09 12:42 
AnswerRe: C# Registry Change Event Pin
cmk6-Feb-09 15:54
cmk6-Feb-09 15:54 
AnswerRe: C# Registry Change Event Pin
Giorgi Dalakishvili6-Feb-09 21:00
mentorGiorgi Dalakishvili6-Feb-09 21:00 
Questionhow to work with an opened text file in list box? Pin
pcsience6-Feb-09 9:57
pcsience6-Feb-09 9:57 
AnswerRe: how to work with an opened text file in list box? Pin
Luc Pattyn6-Feb-09 10:12
sitebuilderLuc Pattyn6-Feb-09 10:12 
GeneralRe: how to work with an opened text file in list box? Pin
pcsience7-Feb-09 8:25
pcsience7-Feb-09 8:25 
AnswerRe: how to work with an opened text file in list box? Pin
Luc Pattyn7-Feb-09 9:09
sitebuilderLuc Pattyn7-Feb-09 9:09 
Hi,

please next time use the "code block" button to publish code, that way you get PRE tags which
provide a background and a monospaced font, and preserve formatting; all this makes it a lot
easier to read and help you.

Nevertheless there are two major errors I could spot:

1.
you are using File.ReadAllText() which returns a single string, hence your listbox contains only one item.

2.
you are using ListBox.Find(string str) which searches for an item STARTING with str, probably
not finding anything (because you only have one item, and it probably does not start with @)

You will need some more code to get your app to do what you want...

BTW: I advise against MessageBox for tracing what is going on, because you can see only one at a
time, once closed they are gone forever, and they soon become very annoying. I recommend you use
Console.WriteLine() instead. That creates a trace log in the output pane of Visual Studio, and does
not stop your thread.

Smile | :)
Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


modified on Friday, June 10, 2011 11:26 PM

QuestionRe: how to work with an opened text file in list box? Pin
pcsience8-Feb-09 8:53
pcsience8-Feb-09 8:53 
AnswerRe: how to work with an opened text file in list box? Pin
Luc Pattyn8-Feb-09 9:03
sitebuilderLuc Pattyn8-Feb-09 9:03 
GeneralRe: how to work with an opened text file in list box? Pin
pcsience8-Feb-09 9:42
pcsience8-Feb-09 9:42 
AnswerRe: how to work with an opened text file in list box? Pin
Luc Pattyn8-Feb-09 10:04
sitebuilderLuc Pattyn8-Feb-09 10:04 
QuestionRe: how to work with an opened text file in list box? Pin
pcsience9-Feb-09 9:08
pcsience9-Feb-09 9:08 
AnswerRe: how to work with an opened text file in list box? Pin
Luc Pattyn9-Feb-09 9:19
sitebuilderLuc Pattyn9-Feb-09 9:19 
QuestionCannot figure out how to get the row I need in a datatable Pin
compninja256-Feb-09 9:49
compninja256-Feb-09 9:49 
AnswerRe: Cannot figure out how to get the row I need in a datatable Pin
Luc Pattyn6-Feb-09 10:03
sitebuilderLuc Pattyn6-Feb-09 10:03 
GeneralRe: Cannot figure out how to get the row I need in a datatable Pin
compninja256-Feb-09 10:19
compninja256-Feb-09 10:19 
GeneralRe: Cannot figure out how to get the row I need in a datatable Pin
compninja259-Feb-09 3:04
compninja259-Feb-09 3:04 
AnswerRe: Cannot figure out how to get the row I need in a datatable Pin
Ennis Ray Lynch, Jr.6-Feb-09 10:48
Ennis Ray Lynch, Jr.6-Feb-09 10:48 
GeneralRe: Cannot figure out how to get the row I need in a datatable Pin
compninja259-Feb-09 2:13
compninja259-Feb-09 2:13 
GeneralRe: Cannot figure out how to get the row I need in a datatable Pin
Ennis Ray Lynch, Jr.9-Feb-09 2:42
Ennis Ray Lynch, Jr.9-Feb-09 2:42 
GeneralRe: Cannot figure out how to get the row I need in a datatable [modified] Pin
compninja259-Feb-09 2:52
compninja259-Feb-09 2:52 
QuestionIs using a User Control Embedded Class a good practice? Pin
MacSpudster6-Feb-09 9:05
professionalMacSpudster6-Feb-09 9:05 
AnswerNot really the place for this question Pin
Pete O'Hanlon6-Feb-09 11:26
mvePete O'Hanlon6-Feb-09 11:26 
GeneralRe: Not really the place for this question Pin
MacSpudster9-Feb-09 8:34
professionalMacSpudster9-Feb-09 8:34 

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.