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

C#

 
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 
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 
Hi,

this is all wrong.

1. event handlers get executed on the main thread (aka GUI thread), hence MouseUp cannot do anything as long as MouseDown is active.

2. Your while loop will never exit.

3. Your while loop has no delay, so at what rate will VolumeDown be called?

4. Using Thread.Sleep would not be a good approach as that blocks the GUI; using a timer (a Windows.Forms.Timer) is the perfect solution: start the timer on MouseDown, stop it on MouseUp (or better yet have the Tick handler check Control.MouseButtons).


Zap-Man wrote:
I don't want to use a timer


why? because you don't understand them? because you don't like a clean and natural solution?

Smile | :)

Luc Pattyn

I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages

Local announcement (Antwerp region): Lange Wapper? Neen!


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 
AnswerRe: Couple of questions regarding Windows Service in C# Pin
Dave Kreskowiak16-Oct-09 18:22
mveDave Kreskowiak16-Oct-09 18:22 
AnswerRe: Couple of questions regarding Windows Service in C# Pin
PIEBALDconsult17-Oct-09 5:40
mvePIEBALDconsult17-Oct-09 5:40 
QuestionForm flickering problem Pin
SimpleData16-Oct-09 9:55
SimpleData16-Oct-09 9:55 
AnswerRe: Form flickering problem Pin
Luc Pattyn16-Oct-09 10:25
sitebuilderLuc Pattyn16-Oct-09 10:25 

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.