Click here to Skip to main content
15,885,216 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: While MouseDown Pin
Not Active17-Oct-09 6:15
mentorNot Active17-Oct-09 6:15 
AnswerRe: While MouseDown Pin
dojohansen18-Oct-09 0:49
dojohansen18-Oct-09 0:49 
QuestionOwner drawn TabControl doesn't act as I want it Pin
WebMaster17-Oct-09 0:20
WebMaster17-Oct-09 0:20 
AnswerRe: Owner drawn TabControl doesn't act as I want it Pin
WebMaster17-Oct-09 21:28
WebMaster17-Oct-09 21:28 
GeneralRe: Owner drawn TabControl doesn't act as I want it Pin
Dave Kreskowiak18-Oct-09 2:33
mveDave Kreskowiak18-Oct-09 2:33 
QuestionIndexing a property that returns an array. [modified] Pin
CaptainSeeSharp16-Oct-09 17:15
CaptainSeeSharp16-Oct-09 17:15 
AnswerRe: Indexing a property that returns an array. [modified] Pin
Luc Pattyn16-Oct-09 17:49
sitebuilderLuc Pattyn16-Oct-09 17:49 
AnswerRe: Indexing a property that returns an array. Pin
dojohansen18-Oct-09 0:59
dojohansen18-Oct-09 0:59 
QuestionCouple of questions regarding Windows Service in C# Pin
Aryan S16-Oct-09 17:14
Aryan S16-Oct-09 17:14 

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.