Click here to Skip to main content
15,897,518 members
Home / Discussions / C#
   

C#

 
GeneralRe: Can't bind listbox to IList Pin
Alan Balkany23-Jan-08 5:01
Alan Balkany23-Jan-08 5:01 
GeneralRe: Can't bind listbox to IList Pin
Alan Balkany23-Jan-08 5:03
Alan Balkany23-Jan-08 5:03 
GeneralSerializing Generic List<another class=""></another> Pin
RichardContact-123-Jan-08 2:36
RichardContact-123-Jan-08 2:36 
GeneralRe: Serializing Generic List Pin
led mike23-Jan-08 4:38
led mike23-Jan-08 4:38 
GeneralAnother WS x WCF Pin
Walter Dias23-Jan-08 2:19
professionalWalter Dias23-Jan-08 2:19 
Generalcreate new items and get data from them Pin
Member 464351023-Jan-08 2:14
Member 464351023-Jan-08 2:14 
GeneralCopying columns from one DataTable to another DataTable Pin
free_soul42423-Jan-08 2:01
free_soul42423-Jan-08 2:01 
GeneralRe: Copying columns from one DataTable to another DataTable Pin
PIEBALDconsult23-Jan-08 2:58
mvePIEBALDconsult23-Jan-08 2:58 
GeneralRe: Copying columns from one DataTable to another DataTable Pin
free_soul42423-Jan-08 17:27
free_soul42423-Jan-08 17:27 
GeneralBackgroundWorker question Pin
RugbyLeague23-Jan-08 1:50
RugbyLeague23-Jan-08 1:50 
GeneralRe: BackgroundWorker question Pin
Ed.Poore23-Jan-08 1:56
Ed.Poore23-Jan-08 1:56 
GeneralRe: BackgroundWorker question Pin
RugbyLeague23-Jan-08 2:03
RugbyLeague23-Jan-08 2:03 
GeneralRe: BackgroundWorker question Pin
S. Senthil Kumar23-Jan-08 6:09
S. Senthil Kumar23-Jan-08 6:09 
GeneralRe: BackgroundWorker question Pin
RugbyLeague23-Jan-08 6:21
RugbyLeague23-Jan-08 6:21 
GeneralRe: BackgroundWorker question Pin
S. Senthil Kumar23-Jan-08 6:53
S. Senthil Kumar23-Jan-08 6:53 
GeneralRe: BackgroundWorker question Pin
RugbyLeague23-Jan-08 6:54
RugbyLeague23-Jan-08 6:54 
GeneralRe: BackgroundWorker question Pin
Ed.Poore23-Jan-08 7:18
Ed.Poore23-Jan-08 7:18 
Not quite, you're probably going to get a ThreadAccessException if you do that. You'll need to create a delegate which can return the value. You can then pass this delegate to the Control.Invoke method to retrieve the value. Alternatively you can use the feature of anonymous delegates (can't remember what it's called) where you can access the variables surrounding it. E.g. (note I'm writing this code from memory)
C#
internal delaget int GetCurrentCount();
private int count = 100;

private void BackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
{
  // Some code here
  int threadedCount = -1;
  // Now we want to return the value so...
  this.Invoke(new GetCurrentCount(delegate() { threadedCount = this.count; }));

  // Now threadedCount should equal 100
  // More code...
}



Generalhttp port listening using sockets. Pin
_tasleem23-Jan-08 1:30
_tasleem23-Jan-08 1:30 
GeneralRe: http port listening using sockets. Pin
stancrm23-Jan-08 1:46
stancrm23-Jan-08 1:46 
QuestionHow to preview setup dialogs in setup project ? Pin
hdv21223-Jan-08 1:29
hdv21223-Jan-08 1:29 
AnswerRe: How to preview setup dialogs in setup project ? Pin
hdv21223-Jan-08 10:43
hdv21223-Jan-08 10:43 
GeneralRe: How to preview setup dialogs in setup project ? Pin
Jimmanuel23-Jan-08 11:22
Jimmanuel23-Jan-08 11:22 
QuestionTree View Pin
Aparna.B23-Jan-08 1:10
Aparna.B23-Jan-08 1:10 
GeneralRe: Tree View Pin
Justin Perez23-Jan-08 3:57
Justin Perez23-Jan-08 3:57 
GeneralRe: Tree View Pin
Aparna.B23-Jan-08 16:40
Aparna.B23-Jan-08 16:40 

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.