Click here to Skip to main content
15,899,026 members
Home / Discussions / C#
   

C#

 
GeneralEvents with .Net remoting Pin
Member 164882911-Jan-05 23:46
Member 164882911-Jan-05 23:46 
GeneralCalling C# DLL through Borland C++ Pin
kinju11-Jan-05 23:16
kinju11-Jan-05 23:16 
GeneralUpdateLayeredWindow problem ... Pin
Axonn Echysttas11-Jan-05 21:57
Axonn Echysttas11-Jan-05 21:57 
GeneralRe: UpdateLayeredWindow problem ... Pin
Dave Kreskowiak12-Jan-05 4:52
mveDave Kreskowiak12-Jan-05 4:52 
GeneralPocket PC Application Pin
vksrisridhar11-Jan-05 21:20
vksrisridhar11-Jan-05 21:20 
QuestionHow to create a "Double Click event" Pin
lee meng11-Jan-05 20:47
lee meng11-Jan-05 20:47 
AnswerRe: How to create a "Double Click event" Pin
Stefan Troschuetz11-Jan-05 21:20
Stefan Troschuetz11-Jan-05 21:20 
GeneralRe: How to create a "Double Click event" Pin
J4amieC11-Jan-05 22:30
J4amieC11-Jan-05 22:30 
Stefan Troschütz wrote:
To achieve this, start a simple timer in the event handler and check whether its interval has elapsed

This is an old VB trick, and is more or less obsolete with .NET

An easier way is to handle the MouseDown event on your button, which raises an event with MouseEventArgs which in turn has a Clicks property. Here is some simple code to demonstrate:

private void button2_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
	Console.WriteLine(e.Clicks);
}


If you associate this with a button (in my case it was named button2), run the project in debug mode, and click the button while watching your Output window you should see a list of 1's & 2's coming up based on the number of clicks recieved on the button. So your code should read along the lines of

if(e.Clicks == 1)
  // Change button text to "Hi"
else
  // Change button text to "Hello"


HTH
GeneralRe: How to create a "Double Click event" Pin
Stefan Troschuetz11-Jan-05 22:43
Stefan Troschuetz11-Jan-05 22:43 
GeneralRe: How to create a "Double Click event" Pin
lee meng12-Jan-05 4:06
lee meng12-Jan-05 4:06 
GeneralRe: How to create a "Double Click event" Pin
Stefan Troschuetz12-Jan-05 4:15
Stefan Troschuetz12-Jan-05 4:15 
AnswerRe: Thank You Pin
lee meng12-Jan-05 5:46
lee meng12-Jan-05 5:46 
GeneralProblem with parameters (Registry) Pin
FireDK11-Jan-05 20:43
FireDK11-Jan-05 20:43 
GeneralDatetime regional format Pin
sevan11-Jan-05 19:09
sevan11-Jan-05 19:09 
GeneralRe: Datetime regional format Pin
Stefan Troschuetz11-Jan-05 21:05
Stefan Troschuetz11-Jan-05 21:05 
GeneralTwo Assemblies in GAC Pin
IamADotNetGuy11-Jan-05 18:58
IamADotNetGuy11-Jan-05 18:58 
GeneralRe: Two Assemblies in GAC Pin
Jesse Squire12-Jan-05 7:01
Jesse Squire12-Jan-05 7:01 
GeneralRe: Two Assemblies in GAC Pin
IamADotNetGuy12-Jan-05 18:14
IamADotNetGuy12-Jan-05 18:14 
GeneralRe: Two Assemblies in GAC Pin
Jesse Squire13-Jan-05 2:26
Jesse Squire13-Jan-05 2:26 
GeneralRef Key word Pin
IamADotNetGuy11-Jan-05 18:55
IamADotNetGuy11-Jan-05 18:55 
GeneralRe: Ref Key word Pin
Corinna John11-Jan-05 21:02
Corinna John11-Jan-05 21:02 
GeneralRe: Ref Key word Pin
leppie12-Jan-05 6:22
leppie12-Jan-05 6:22 
GeneralRe: Ref Key word Pin
Corinna John12-Jan-05 7:19
Corinna John12-Jan-05 7:19 
GeneralHangs while opening word in C# Pin
itssuk11-Jan-05 18:37
itssuk11-Jan-05 18:37 
GeneralRe: Hangs while opening word in C# Pin
Dave Kreskowiak12-Jan-05 4:29
mveDave Kreskowiak12-Jan-05 4:29 

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.