Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
AnswerRe: Foreach cannot operate on a 'method group'. Did you intend to invoke the 'method group'? Pin
Luc Pattyn12-Aug-10 7:54
sitebuilderLuc Pattyn12-Aug-10 7:54 
AnswerRe: Foreach cannot operate on a 'method group'. Did you intend to invoke the 'method group'? Pin
Ian Shlasko12-Aug-10 7:55
Ian Shlasko12-Aug-10 7:55 
AnswerRe: Foreach cannot operate on a 'method group'. Did you intend to invoke the 'method group'? Pin
Luc Pattyn12-Aug-10 8:10
sitebuilderLuc Pattyn12-Aug-10 8:10 
GeneralRe: Foreach cannot operate on a 'method group'. Did you intend to invoke the 'method group'? Pin
Ian Shlasko12-Aug-10 8:24
Ian Shlasko12-Aug-10 8:24 
GeneralRe: Foreach cannot operate on a 'method group'. Did you intend to invoke the 'method group'? Pin
Luc Pattyn12-Aug-10 8:57
sitebuilderLuc Pattyn12-Aug-10 8:57 
GeneralRe: Foreach cannot operate on a 'method group'. Did you intend to invoke the 'method group'? Pin
AspDotNetDev12-Aug-10 7:56
protectorAspDotNetDev12-Aug-10 7:56 
GeneralRe: Foreach cannot operate on a 'method group'. Did you intend to invoke the 'method group'? Pin
Tichaona J12-Aug-10 9:16
Tichaona J12-Aug-10 9:16 
GeneralRe: Foreach cannot operate on a 'method group'. Did you intend to invoke the 'method group'? Pin
Tichaona J12-Aug-10 11:01
Tichaona J12-Aug-10 11:01 
I finally figured it out, this works as intended:

//Open files into the list box
private void btnLoad_Click(object sender, RoutedEventArgs e)
{
//Declare an instance of the open file dialog...
OpenFileDialog dlg = new OpenFileDialog();

//Set properties for the dialog...
dlg.Title = "Select one or more media files";
dlg.Multiselect = IsEnabled;
dlg.Filter = "Media files(*.mp3;*.wav;*.wma;*.avi;*.mp4;*.mpg;*.wmv)|*.mp3;*.wav;*.wma;*.avi;*.mp4;*.mpg;*.wmv|All files(*.*)|*.*";

//The result of the open file dialog is either true or false (didn't work).
Nullable<bool> result = dlg.ShowDialog();

//If the result of the open file dialog was true then....
if (result == true)
{

string[] files;

files = dlg.FileNames;

foreach (string file in files)
{
lstBxList.Items.Add(file);
}

}
}
AnswerRe: Foreach cannot operate on a 'method group'. Did you intend to invoke the 'method group'? Pin
Luc Pattyn12-Aug-10 11:28
sitebuilderLuc Pattyn12-Aug-10 11:28 
QuestionHow to update text (winform) from different thread ? ( What wrong with my code ?! ) Pin
Yanshof12-Aug-10 5:59
Yanshof12-Aug-10 5:59 
AnswerRe: How to update text (winform) from different thread ? ( What wrong with my code ?! ) Pin
AspDotNetDev12-Aug-10 8:02
protectorAspDotNetDev12-Aug-10 8:02 
AnswerRe: How to update text (winform) from different thread ? ( What wrong with my code ?! ) Pin
Ennis Ray Lynch, Jr.12-Aug-10 8:07
Ennis Ray Lynch, Jr.12-Aug-10 8:07 
GeneralRe: How to update text (winform) from different thread ? ( What wrong with my code ?! ) Pin
Yanshof12-Aug-10 13:01
Yanshof12-Aug-10 13:01 
Questionhow to set preprocessing when using devenv from the command line? Pin
mersad0012-Aug-10 4:09
mersad0012-Aug-10 4:09 
AnswerRe: how to set preprocessing when using devenv from the command line? Pin
Richard MacCutchan12-Aug-10 4:28
mveRichard MacCutchan12-Aug-10 4:28 
QuestionRe: how to set preprocessing when using devenv from the command line? Pin
mersad0013-Aug-10 7:41
mersad0013-Aug-10 7:41 
AnswerRe: how to set preprocessing when using devenv from the command line? Pin
Richard MacCutchan13-Aug-10 8:48
mveRichard MacCutchan13-Aug-10 8:48 
Questionlinq query with "IN" Pin
treuveni12-Aug-10 1:55
treuveni12-Aug-10 1:55 
AnswerRe: linq query with "IN" Pin
Łukasz Nowakowski12-Aug-10 2:56
Łukasz Nowakowski12-Aug-10 2:56 
AnswerRe: linq query with "IN" Pin
Ennis Ray Lynch, Jr.12-Aug-10 3:13
Ennis Ray Lynch, Jr.12-Aug-10 3:13 
GeneralRe: linq query with "IN" Pin
treuveni12-Aug-10 3:34
treuveni12-Aug-10 3:34 
GeneralRe: linq query with "IN" Pin
Łukasz Nowakowski12-Aug-10 3:38
Łukasz Nowakowski12-Aug-10 3:38 
GeneralRe: linq query with "IN" Pin
Richard Blythe12-Aug-10 4:36
Richard Blythe12-Aug-10 4:36 
GeneralRe: linq query with "IN" Pin
Dan Mos12-Aug-10 9:44
Dan Mos12-Aug-10 9:44 
GeneralRe: linq query with "IN" Pin
Ennis Ray Lynch, Jr.12-Aug-10 9:47
Ennis Ray Lynch, Jr.12-Aug-10 9:47 

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.