Click here to Skip to main content
15,889,462 members
Home / Discussions / C#
   

C#

 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Cristian Capannini6-Nov-12 21:24
Cristian Capannini6-Nov-12 21:24 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Cristian Capannini6-Nov-12 2:40
Cristian Capannini6-Nov-12 2:40 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Eddy Vluggen6-Nov-12 2:42
professionalEddy Vluggen6-Nov-12 2:42 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Cristian Capannini6-Nov-12 2:46
Cristian Capannini6-Nov-12 2:46 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Eddy Vluggen6-Nov-12 3:04
professionalEddy Vluggen6-Nov-12 3:04 
QuestionProblem with Excel WorksheetFunction.Growth in c# Pin
Ross R4-Nov-12 23:17
Ross R4-Nov-12 23:17 
Questionavoid double click Pin
neeraj@max4-Nov-12 20:06
neeraj@max4-Nov-12 20:06 
AnswerRe: avoid double click Pin
OriginalGriff4-Nov-12 20:34
mveOriginalGriff4-Nov-12 20:34 
The problem is that the button click event is happening almost immediately - so the second "click" is going to the correct place - the control at that position on the "new" panel. And that will generate a click event for the new button because that is exactly what should happen.
If you want to stop it, then
1) Create a class level variable:
C#
private DateTime lastSwap = DateTime.Now;

2) In the Button1 click handler, set it:
lastSwap = DateTime.Now;
And then swap panels.
3) In the Button2 click handler, check it and ignore if too soon:
if (DateTime.Now < lastSwap.AddMilliseconds(500)) return;

You can change the 500 to any value you think reasonable - 500 provides half a second.
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.

GeneralRe: avoid double click Pin
neeraj@max4-Nov-12 21:09
neeraj@max4-Nov-12 21:09 
GeneralRe: avoid double click Pin
J4amieC4-Nov-12 21:27
J4amieC4-Nov-12 21:27 
GeneralRe: avoid double click Pin
neeraj@max4-Nov-12 23:25
neeraj@max4-Nov-12 23:25 
GeneralRe: avoid double click Pin
Pete O'Hanlon5-Nov-12 0:30
mvePete O'Hanlon5-Nov-12 0:30 
GeneralRe: avoid double click Pin
J4amieC5-Nov-12 1:27
J4amieC5-Nov-12 1:27 
GeneralRe: avoid double click Pin
neeraj@max5-Nov-12 1:43
neeraj@max5-Nov-12 1:43 
GeneralRe: avoid double click Pin
J4amieC5-Nov-12 1:52
J4amieC5-Nov-12 1:52 
GeneralRe: avoid double click Pin
neeraj@max5-Nov-12 19:34
neeraj@max5-Nov-12 19:34 
GeneralRe: avoid double click Pin
J4amieC5-Nov-12 21:43
J4amieC5-Nov-12 21:43 
GeneralRe: avoid double click Pin
neeraj@max6-Nov-12 0:08
neeraj@max6-Nov-12 0:08 
AnswerRe: avoid double click Pin
neeraj@max22-Nov-12 20:02
neeraj@max22-Nov-12 20:02 
QuestionHow to call C++ parameterised function from C# using thread Pin
sjs4u4-Nov-12 4:09
sjs4u4-Nov-12 4:09 
AnswerRe: How to call C++ parameterised function from C# using thread Pin
Richard MacCutchan4-Nov-12 5:14
mveRichard MacCutchan4-Nov-12 5:14 
AnswerRe: How to call C++ parameterised function from C# using thread Pin
DaveyM694-Nov-12 5:29
professionalDaveyM694-Nov-12 5:29 
QuestionHow to declare events? Pin
Andy_L_J3-Nov-12 20:41
Andy_L_J3-Nov-12 20:41 
AnswerRe: How to declare events? Pin
Richard MacCutchan3-Nov-12 21:32
mveRichard MacCutchan3-Nov-12 21:32 
GeneralRe: How to declare events? Pin
Andy_L_J3-Nov-12 22:09
Andy_L_J3-Nov-12 22:09 

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.