Click here to Skip to main content
15,891,316 members
Home / Discussions / C#
   

C#

 
AnswerRe: Updating the password handling Pin
Luc Pattyn16-Nov-11 4:03
sitebuilderLuc Pattyn16-Nov-11 4:03 
GeneralRe: Updating the password handling Pin
Peter_in_278016-Nov-11 10:02
professionalPeter_in_278016-Nov-11 10:02 
GeneralRe: Updating the password handling Pin
Bernhard Hiller16-Nov-11 23:02
Bernhard Hiller16-Nov-11 23:02 
QuestionReading next block of data on button click event Pin
MumbleB15-Nov-11 18:55
MumbleB15-Nov-11 18:55 
AnswerRe: Reading next block of data on button click event Pin
RobCroll15-Nov-11 19:40
RobCroll15-Nov-11 19:40 
AnswerRe: Reading next block of data on button click event Pin
Wayne Gaylard15-Nov-11 19:42
professionalWayne Gaylard15-Nov-11 19:42 
AnswerRe: Reading next block of data on button click event Pin
BobJanova16-Nov-11 3:09
BobJanova16-Nov-11 3:09 
QuestionTimers & editing controls Pin
Krylosac15-Nov-11 16:35
Krylosac15-Nov-11 16:35 
I'm trying to have a timer countdown and once it reaches 0 it would move a value from one gridview to another. The build crashes once it reaches 0 and says something about not being able to change controls on different threads. I did some research and they say I need to Invoke? or create a BackgroundWorker?

C#
System.Threading.Timer timer;
int time = 30;

timer = new System.Threading.Timer(new TimerCallback(timerCallback),
                                   null, 0, 1000);

public void timerCallback(Object obj)
{
 
   // timer-- and display onto label (Code not shown)
   // Once it reaches zero:
   else
   {
      timer = 0;
      
      // Moves row from source grid to destination grid
      moveToGrid(grid1, grid2);
   }
}


The moveToGrid method works fine if I put it in an onClick event but the build crashes when put as shown above. Can anyone point me in the right direction?
AnswerRe: Timers & editing controls Pin
Wayne Gaylard15-Nov-11 17:06
professionalWayne Gaylard15-Nov-11 17:06 
GeneralRe: Timers & editing controls Pin
Krylosac15-Nov-11 17:39
Krylosac15-Nov-11 17:39 
GeneralRe: Timers & editing controls Pin
Wayne Gaylard15-Nov-11 17:53
professionalWayne Gaylard15-Nov-11 17:53 
AnswerRe: Timers & editing controls Pin
Luc Pattyn15-Nov-11 17:28
sitebuilderLuc Pattyn15-Nov-11 17:28 
GeneralRe: Timers & editing controls Pin
BobJanova16-Nov-11 3:11
BobJanova16-Nov-11 3:11 
GeneralRe: Timers & editing controls Pin
Krylosac16-Nov-11 3:24
Krylosac16-Nov-11 3:24 
AnswerRe: Timers & editing controls Pin
Not Active15-Nov-11 17:28
mentorNot Active15-Nov-11 17:28 
QuestionHow To Create Classic Menu in C# desktop apll. Pin
Devdattahack1015-Nov-11 12:27
Devdattahack1015-Nov-11 12:27 
AnswerRe: How To Create Classic Menu in C# desktop apll. Pin
PIEBALDconsult15-Nov-11 13:42
mvePIEBALDconsult15-Nov-11 13:42 
Questionc# image pixel shrink Pin
Member 773856115-Nov-11 8:43
Member 773856115-Nov-11 8:43 
AnswerRe: c# image pixel shrink Pin
Peter_in_278015-Nov-11 13:23
professionalPeter_in_278015-Nov-11 13:23 
GeneralRe: c# image pixel shrink Pin
Smithers-Jones15-Nov-11 22:23
Smithers-Jones15-Nov-11 22:23 
AnswerRe: c# image pixel shrink Pin
BillWoodruff16-Nov-11 14:54
professionalBillWoodruff16-Nov-11 14:54 
QuestionQuick way to add block comments? Pin
jclark239b915-Nov-11 6:55
jclark239b915-Nov-11 6:55 
AnswerRe: Quick way to add block comments? PinPopular
OriginalGriff15-Nov-11 9:37
mveOriginalGriff15-Nov-11 9:37 
GeneralRe: Quick way to add block comments? Pin
jclark239b915-Nov-11 10:26
jclark239b915-Nov-11 10:26 
AnswerRe: Quick way to add block comments? Pin
BobJanova16-Nov-11 3:13
BobJanova16-Nov-11 3:13 

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.