Click here to Skip to main content
16,017,261 members
Home / Discussions / C#
   

C#

 
GeneralRe: Thanks everyone - results Pin
DaveyM6918-Oct-09 3:51
professionalDaveyM6918-Oct-09 3:51 
GeneralRe: Thanks everyone - results Pin
Trollslayer18-Oct-09 3:57
mentorTrollslayer18-Oct-09 3:57 
GeneralRe: Thanks everyone - results Pin
DaveyM6918-Oct-09 4:04
professionalDaveyM6918-Oct-09 4:04 
Questiongetting Bios date from c# in win64 environments Pin
Fred 3417-Oct-09 7:17
Fred 3417-Oct-09 7:17 
AnswerRe: getting Bios date from c# in win64 environments Pin
Abhijit Jana17-Oct-09 8:24
professionalAbhijit Jana17-Oct-09 8:24 
GeneralRe: getting Bios date from c# in win64 environments Pin
Fred 3417-Oct-09 9:09
Fred 3417-Oct-09 9:09 
GeneralRe: getting Bios date from c# in win64 environments Pin
Richard MacCutchan17-Oct-09 9:30
mveRichard MacCutchan17-Oct-09 9:30 
GeneralRe: getting Bios date from c# in win64 environments Pin
Abhijit Jana17-Oct-09 9:58
professionalAbhijit Jana17-Oct-09 9:58 
AnswerRe: getting Bios date from c# in win64 environments Pin
Vimalsoft(Pty) Ltd17-Oct-09 8:58
professionalVimalsoft(Pty) Ltd17-Oct-09 8:58 
AnswerRe: getting Bios date from c# in win64 environments Pin
dan!sh 17-Oct-09 9:49
professional dan!sh 17-Oct-09 9:49 
AnswerRe: getting Bios date from c# in win64 environments Pin
Dave Kreskowiak18-Oct-09 2:34
mveDave Kreskowiak18-Oct-09 2:34 
QuestionTextObject in CrystalReport Pin
ZeinabTavana17-Oct-09 6:52
ZeinabTavana17-Oct-09 6:52 
Questiongetting biosdate Pin
Fred 3417-Oct-09 5:58
Fred 3417-Oct-09 5:58 
AnswerRe: getting biosdate Pin
Not Active17-Oct-09 10:31
mentorNot Active17-Oct-09 10:31 
GeneralRe: getting biosdate Pin
Luc Pattyn17-Oct-09 12:17
sitebuilderLuc Pattyn17-Oct-09 12:17 
GeneralRe: getting biosdate Pin
Not Active17-Oct-09 16:21
mentorNot Active17-Oct-09 16:21 
QuestionWhile MouseDown Pin
Zap-Man17-Oct-09 3:27
Zap-Man17-Oct-09 3:27 
I am trying to do some events while the mouse button is down.
Here is what I have

private static bool IsKeyDown = false;

private void button1_MouseDown(object sender, MouseEventArgs e) {
IsKeyDown = true;
while (IsKeyDown) {
Winamp.Winamp.VolumeDown();

}

}

private void button1_MouseUp(object sender, MouseEventArgs e) {

IsKeyDown = false;

}

The problem is when it hits the mouse down event It continues to run the while loop and does not hit the mouse up event.

I don't want to use a timer to do this.

I did see some code that I think will work better in my app but I cant seem to get it to work can some one please help.

http://stackoverflow.com/questions/1152525/c-winform-looping-event-on-press-button[^]

private bool mouseDown = false;

private void buttonScrollUp_MouseDown(object sender, MouseEventArgs e)
{
mouseDown = true;
new Thread(() => {
while (mouseDown)
{
Invoke(new MethodInvoker(() => [DO_THE_SCROLLING_HERE));
Thread.Sleep([SET_AUTOREPEAT_TIMEOUT_HERE);
}
})
.Start();
}

private void buttonScrollUp_MouseUp(object sender, MouseEventArgs e)
{
mouseDown = false;
}
AnswerRe: While MouseDown Pin
Lyon Sun17-Oct-09 4:00
Lyon Sun17-Oct-09 4:00 
GeneralRe: While MouseDown Pin
Zap-Man17-Oct-09 4:09
Zap-Man17-Oct-09 4:09 
AnswerRe: While MouseDown Pin
Richard MacCutchan17-Oct-09 4:44
mveRichard MacCutchan17-Oct-09 4:44 
AnswerRe: While MouseDown PinPopular
Luc Pattyn17-Oct-09 5:08
sitebuilderLuc Pattyn17-Oct-09 5:08 
GeneralRe: While MouseDown Pin
Zap-Man17-Oct-09 5:43
Zap-Man17-Oct-09 5:43 
GeneralRe: While MouseDown Pin
Not Active17-Oct-09 6:17
mentorNot Active17-Oct-09 6:17 
AnswerRe: While MouseDown Pin
Not Active17-Oct-09 5:42
mentorNot Active17-Oct-09 5:42 
GeneralRe: While MouseDown Pin
Zap-Man17-Oct-09 5:46
Zap-Man17-Oct-09 5:46 

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.